Struktury jako klucze w mapach Go

Szukałem użycia struktur jako kluczy w mapach golanga. Pole w tej strukturze powinno być również mapą i wydaje się, że jest sprzeczne z dostarczoną dokumentacjątutaj który mówi, że tylko struktury, które mają pola, które można porównać== i!= może być w polach struktur, które są używane jako klucze w mapach. Jednak postanowiłem spróbować następujących rzeczy:

package main

import "fmt"
import "strings"

func main() {
    fmt.Println("Hello, 世界")
    fmt.Println(strings.Join([]string{"obi", "$", "56"}, ""))
    z := make(map[string]float64)

    z["obi"] = 0.003

    x := &test{
        name:"testing",
        code:z,
    }

    a := &test{
        name:"testing2",
        code:z,
    }

    y := make(map[*test] string)

    y[x] = "go home"
    y[a] = "come home"

    for key, val := range y{
        fmt.Println(key.name, key.code, val)
    }

}

type test struct{
    name string
    code map[string]float64
}

Wynik był:

Hello, 世界
obi$56
testing map[obi:0.003] go home
testing2 map[obi:0.003] come home

Wydaje się, że jest to sprzeczne z dokumentacją, ponieważ pole w strukturze używanej jako klucz jest mapą. Co wydaje mi się nie tak?

questionAnswers(1)

yourAnswerToTheQuestion