What happens when you read a missing key from a Go map?
Answer & explanation
Answer: You get the element type’s zero value
A map lookup returns the zero value when absent; the comma-ok form distinguishes absent keys.
Practice maps with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
Answer: You get the element type’s zero value
A map lookup returns the zero value when absent; the comma-ok form distinguishes absent keys.