feat: honour the omitzero and omitempty tag options on encode
Assisted-by: GLM 5.3 Flash
This commit is contained in:
+5
-1
@@ -9,7 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Added
|
||||
|
||||
-
|
||||
- `omitzero` and `omitempty` tag options on encode: `toml:"name,omitzero"`
|
||||
skips a field whose value is the zero value of its type (a type with an
|
||||
`IsZero() bool` method decides through the method), and
|
||||
`toml:"name,omitempty"` skips a nil or empty slice, array, or map. The
|
||||
decoder ignores both options.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user