File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 115115//
116116// When decoding from a struct to any other value, you may use the
117117// ",omitempty" suffix on your tag to omit that value if it equates to
118- // the zero value. The zero value of all types is specified in the Go
119- // specification.
118+ // the zero value, or a zero-length element . The zero value of all types is
119+ // specified in the Go specification.
120120//
121121// For example, the zero type of a numeric type is zero ("0"). If the struct
122122// field value is zero and a numeric type, the field is empty, and it won't
123- // be encoded into the destination type.
123+ // be encoded into the destination type. And likewise for the URLs field, if the
124+ // slice is nil or empty, it won't be encoded into the destination type.
124125//
125126// type Source struct {
126- // Age int `mapstructure:",omitempty"`
127+ // Age int `mapstructure:",omitempty"`
128+ // URLs []string `mapstructure:",omitempty"`
127129// }
128130//
129131// # Unexported fields
You can’t perform that action at this time.
0 commit comments