У меня есть следующий JSON
{"a":1, "b":2, "?":1, "??":1}
Я знаю, что он имеет поля "a" и "b", но я не знаю имен других полей. Поэтому я хочу размонтировать его в следующем типе:
type Foo struct {
// Known fields
A int `json:"a"`
B int `json:"b"`
// Unknown fields
X map[string]interface{} `json:???` // Rest of the fields should go here.
}
Как это сделать?