Go gotchas, surprises, puzzles.
Other lists and articles:
- 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs
- Do you make these Go coding mistakes?
- Common Gotchas in Go
Other gotchas and questions
Embedded struct literal
The JSON unmarshaler works with embedded struct, while literal initialization will not.
prog.go:31:13: cannot use promoted field A.A1 in struct literal of type B
Missing high index causes out of range
The high index of a slice is not what it seems.
panic: runtime error: slice bounds out of range