Section 11 of 11

Gotchas

The list worth flashcarding. Each one has bitten everybody.

The nil interface trap

go.dev playground

Try it: This is the #1 Go interview question. An interface is (type, value) — it is only nil when BOTH are nil.

Slices share a backing array

go.dev playground

Try it: Append past cap and the aliasing silently stops. That inconsistency is the bug.