Use structs as keys when you need composite keys:
type Point struct {
X, Y int
}
visited := make(map[Point]bool)
visited[Point{1, 2}] = true
visited[Point{3, 4}] = true
if visited[Point{1, 2}] {
fmt.Println("Already visited!")
}
This is useful for grid-based problems, caching with multiple parameters, or any situation where a key has multiple components.