Curriculum Idioms & ecosystem
module 7 of 7
Idioms & ecosystem
Graduating to "real Go" — defer, embedding, context, testing, the small-interface idiom, project layout, and the gotchas every Go programmer learns the hard way.
themes
io.Reader { Read(p []byte) (n int, err error) }. One method.
Go interfaces are typically tiny because implicit satisfaction
rewards it — small interfaces are easy to satisfy acci…
7.6
Project layout
cmd/<binary-name>/main.go per binary; internal/... for
packages that should not be importable by other modules. Outside
those two conventions, layout is up to you. The `golang-…
7.7
Common gotchas
The "what bit me in code review" survival kit: - Loop variable capture (Go 1.22+ helped, but you should still know). - Nil interface vs nil concrete (a non-nil pointer inside an…