← Back to archive

Stdle #85 · classes · 2026-08-30

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
type Key struct {
A int
B string
}
func main() {
m := map[Key]int{}
m[Key{1, "x"}] = 7
fmt.Println(m[Key{1, "x"}])
}
Classes
4 attempts left

Answer & explanation