```go
// The Go visibility rules for struct fields are amended for JSON when
// deciding which field to marshal or unmarshal. If there are
// multiple fields at the same level, and that level is the least
// nested (and would therefore be the nesting level selected by the
// usual Go rules), the following extra rules apply:
//
// 1) Of those fields, if any are JSON-tagged, only tagged fields are considered,
// even if there are multiple untagged fields that would otherwise conflict.
//
// 2) If there is exactly one field (tagged or not according to the first rule), that is selected.
//
// 3) Otherwise there are multiple fields, and all are ignored; no error occurs.
//
```
其中的`the least nested`最小嵌套是什么意思?这里的A,B,C三个struct哪个是最小嵌套?
```go
type Int int
type C struct {
Int
}
type B struct {
C
Int
}
type A struct {
B
Int
}
```
有疑问加站长微信联系(非本文作者)