```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
}
```
举个例子:A嵌套B和C,C嵌套D。
如果A/B/C/D都有一个ID的字段,此时用哪个?显然是A,因为最外层深度最小。
如果只有D有json标签,此时用D,因为json标签专门为序列化设计的。
如果B、C也有json标签,那就死翘翘了,因为它俩深度一样,无法确定哪一个。
#1