{
"map": {
{
"name": "js",
"age": 18
}: {
"id": 10,
"port": 1234
}
}
}
转换成
type ST2 struct {
Id int `json:"id"`
Port int `json:"port"`
}
type ST1 struct {
Name string `json:"name"`
Age int `json:"age"`
}
type ST struct {
Map map[ST1]ST2 `json:"map"`
}
网上找了一堆,都是 map[string]struct 的转换,到这种 map[struct]struct 就不行了
报错信息是
invalid character '{' looking for beginning of object key string