Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGotype constraints and comparableSingle-choice MCQ

What does this program print or do, given a map keyed by a generic comparable type parameter where an interface holding a slice is used as the key?

package main import "fmt" func add[K comparable](m map[K]int, k K) { m[k]++ } func main() { m := map[any]int{} add(m, []int{1, 2}) fmt.Println(len(m)) }