IsZeroer is used to check whether an object is zero to determine whether it should be omitted when marshaling with the omitempty flag. One notable implementation is time.Time.
| 654 | // with the omitempty flag. One notable implementation |
| 655 | // is time.Time. |
| 656 | type IsZeroer interface { |
| 657 | IsZero() bool |
| 658 | } |
| 659 | |
| 660 | func isZero(v reflect.Value) bool { |
| 661 | kind := v.Kind() |