Go assigns every newly declared variable a default value when no explicit initializer is provided. Boolean values receive false, numeric values receive 0, strings receive "", and other types receive nil. This makes many variables immediately usable without a separate initialization step. section 2.4.8
The principle also applies when reading a missing map key: Go returns the zero value for the map's element type rather than panicking. Use the two-value lookup when distinguishing an absent key from a stored zero value matters. section 4.3.2
Membership queries with a map
A map[string]bool can store only members whose values are true. Looking up an unlisted name returns false, so a direct condition answers membership without requiring every nonmember to be stored. section 4.3.2
Missing numeric data
Reading wordsWritten["Eve"] from a map[string]int returns 0 when Eve has no entry, allowing an untracked person to be treated as having written zero words.




