Quick testing shows that you can use arrays:
func main() {
a := [4]int{1,2,3,4}
m := make(map[[4]int]string)
m[a] = "Hello"
fmt.Println(m[[4]int{1,2,3,4}])
}
Although that will be klunky, since the size of the array is in the type of the array. And still mutable. Mutating keys is bad.In all my years of using maps, I can't think of when I wanted to index by something that was truly an arbitrary-length array of things. If you want to index by something like a tuple of things, declare a datatype for that purpose. What exactly are you trying to do by using a slice as a key?