Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "A map may legitimately store zero. How should code distinguish an absent key from a present key mapped to zero?" on CodeWiki (https://codewiki.com/practice/mcq/go/checkpoint-2/checkpoint-2-map-presence/).
Context (verbatim from the page):
"""
A map may legitimately store zero. How should code distinguish an absent key from a present key mapped to zero?
Use the two-result lookup `value, ok := counts[key]`.
Test only whether `counts[key] == 0`.
Range over the map because lookup cannot report presence.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in Go. Where you are unsure, say so.