feat: honour the omitzero and omitempty tag options on encode

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-17 19:57:23 +02:00
parent 58e7dfb1d0
commit 93c36cf376
6 changed files with 160 additions and 4 deletions
+5 -1
View File
@@ -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