This is the first release built largely with the help of AI coding agents. Highlights include the complete removal of the unsafe package. go-toml is now fully safe Go code, with a geomean overhead of only ~1.4% vs v2.2.4 and zero additional allocations on benchmarks. This release also adds omitzero struct tag support, improves UnmarshalText/Unmarshaler handling for tables and array tables, and fixes several bugs including nil pointer marshaling, leap second handling, and datetime unmarshaling panics.
What's Changed
What's new
- marshal: don't escape quotes unnecessarily by @virtuald in #991
- Add
omitzerotag support by @NathanBaulch in #998 - Support custom IsZero() methods with omitzero tag by @pelletier in #1020
- UnmarshalText fallbacks to struct unmarshaling for tables and arrays by @pelletier in #1026
- [unstable] Support Unmarshaler interface for tables and array tables by @pelletier in #1027
Fixed bugs
- Add missing UnmarshalTOML call by @pelletier in #996
- Handle array table into an empty slice by @pelletier in #997
- Unwrap strict errors by @bersace in #1012
- Fix leap second handling found by fuzz by @pelletier in #1019
- Fix nil pointer map values not being marshaled by @pelletier in #1025
- Fix panic when unmarshaling datetime values to incompatible types (#1028) by @pelletier in #1029
- Fix parser error pointing to wrong line at EOF without trailing newline by @pelletier in #1041
Documentation
- Improve Unmarshaling README by @heckelson in #1016
- Create AGENTS.md guidelines file by @pelletier in #1017
Other changes
- Unsafe package removal by @pelletier in #1021
- Bump CI and test scripts to Go 1.26 by @pelletier in #1030
New Contributors
- @virtuald made their first contribution in #991
- @NathanBaulch made their first contribution in #999
- @bersace made their first contribution in #1012
- @flyn-org made their first contribution in #1013
- @heckelson made their first contribution in #1016
Full Changelog: v2.2.4...v2.3.0