Releases: pelletier/go-toml
v2.0.4
This version has compatibility issues with Go <= 1.17. Though go-toml doesn't officially support Go less than 2 versions old, a new version has been released with a backward-compatible fix: https://github.com/pelletier/go-toml/releases/tag/v2.0.5.
What's Changed
Fixed bugs
- Decode: don't crash on embedded nil pointers by @pelletier in #808
- Add back missing build tag needed for Go 1.16 and earlier by @piotrbulinski in #809
- Decode: don't break on non-struct embed field by @pelletier in #810
New Contributors
- @piotrbulinski made their first contribution in #809
Full Changelog: v2.0.3...v2.0.4
v2.0.3
What's Changed
Fixed bugs
- Encode: define and fix newlines behavior when using omitempty by @pelletier in #798
- Encode: don't inherit omitempty by @pelletier in #803
- Decode: error on array table mismatched type by @pelletier in #804
Other changes
- build(deps): bump github.com/stretchr/testify from 1.7.2 to 1.8.0 by @dependabot in #793 #794 #795
- Go 1.19 by @pelletier in #802
Full Changelog: v2.0.2...v2.0.3
v2.0.2
What's Changed
Fixed bugs
- Encode: add bound check for uint64 > math.Int64 by @pelletier in #785
Other changes
- Build arm + arm64 binaries for linux and windows by @pelletier in #790
Full Changelog: v2.0.1...v2.0.2
v2.0.1
What's Changed
Fixed bugs
- Encode: fix embedded struct with explicit field name by @pelletier in #773
- Encode: fix multiline comment by @pelletier in #775
- Encode: support comment on array tables by @pelletier in #776
- Decode: check max uint on 32 bit platforms by @pelletier in #778
Documentation
New Contributors
Full Changelog: v2.0.0...v2.0.1
v2.0.0
It is finally here! go-toml v2 is now stable. 🎉
Only just over one year after I started working on it. This version of go-toml has been rebuilt from the ground up. It respects the latest TOML specification. Countless bugs have been fixed. It behaves more like the standard library. And it is much faster. Special attention was given to keeping the public API to a minimum. Continuing the strict policy of backward compatibility, the next breaking change will be in another 5 years!
Thank you to everybody who contributed to this new version, as well as folks willing to try out the intermediate beta versions. Shout out to @moorereason for reporting many issues during the development process using differential fuzzing, as well as @bep for running a beta on the popular Hugo project!
There is still some work that could be done to improve the performance of the library (#758 and #669 for instance). But I am confident that the library is in a good-enough place at the moment for folks to reap the benefits of the rewrite. The major feature removal is the sort-of-AST that v1 provided. It allowed manipulating an arbitrary document and writing it back out. This was done to cut down the scope of the project, removing a feature that had unclear use-cases. The v2 parser creates some intermediate AST so that if somebody is up to design a Document API the tools should be available to do so. Please reach out if you are interested!
The readme contains a list of differences between v1 and v2 to be aware of when upgrading. Please report any issue you may have with the new version in the bug tracker 🐞, provide feedback, and ask questions in Discussions 💬.
With this release, go-toml v1 will not be receiving any updates. This is required to keep maintenance of the project to a minimum.
Hopefully, this change doesn't break your thing!
Full commit log: c9a09d8...v2
Thank you contributors: @pelletier @oschwald @moorereason @xwjdsh @kkHAIKE @RiyaJohn @jidicula @zostay @mmorel-35.
v2.0.0-beta.8
Lots of small bug fixes on the encoder. Found thanks to the new Go 1.18 fuzzing support.
What's Changed
Fixed bugs
- Decode: always use UTC for +00:00 timezone by @pelletier in #755
- Encode: fix
LocalDate
formatting by @pelletier in #755 - Encode: fix empty key marshaling by @pelletier in #755
- Encode: fix invalid quotation of
time.Time
by @pelletier in #755 - Encode: ensure control characters are escaped by @pelletier in #755
- Encode: check for invalid characters in keys by @pelletier in #755
- Encode: always construct map for empty array tables by @pelletier in #755
- Encode: don't capitalize
nan
by @pelletier in #755 - Encode: don't capitalize
inf
by @pelletier in #755 - Encode: allow new lines in quoted keys by @pelletier in #755
- Encode: never emit table inside array by @pelletier in #755
- Encode: fix embedded interfaces by @pelletier in #753
Documentation
- Update benchmarks in README by @pelletier in #756
Full Changelog: v2.0.0-beta.7...v2.0.0-beta.8
v2.0.0-beta.7
Small bug fixes version. The main purpose is to provide a valid tag to take a recent dependency on, as 2.0.0-beta.6
had issues (#743).
What's Changed
What's new
- Decode: support \e escape sequence by @pelletier in #748
Fixed bugs
- tools: display error context when it exists by @pelletier in #749
- Decode: allow subtables to be defined later in the document by @pelletier in #750
Other changes
- Decode: remove mention of UnmarshalText in errors by @pelletier in #751
Full Changelog: v2.0.0-beta.6...v2.0.0-beta.7
v2.0.0-beta.6
Long time this the last beta release! This one comes with all the tooling and build systems ported to v2. And a handful of bug-fixes as usual.
v2.0.0-beta.6
tag has been moved, so it is possible you see a checksum mismatch error from Go when using this version (#743). This will be correct in v2.0.0-beta.7
.
What's Changed
Fixed bugs
- Decode: use cleaned byte slice throughout parseFloat by @moorereason in #735
- Decode: convert table key to correct type by @oschwald in #741
- Encoder: respect stdlib rules for embedded structs by @pelletier in #747
Documentation
- Mention removal of go-toml/query by @pelletier in #736
Other changes
- tomljson: port to v2 by @pelletier in #725
- jsontoml: port to v2 by @pelletier in #726
- tomll: port to v2 by @pelletier in #727
- Decoder: rename SetStrict to DisallowUnknownFields by @pelletier in #731
- Go 1.18 by @pelletier in #745
- Update testify dependency by @pelletier in #746
Full Changelog: v2.0.0-beta.5...v2.0.0-beta.6
v1.9.5
v2.0.0-beta.5
While this release focused on adding back missing encoder and decoder features, it also comes with a slew of bug fixes, thanks to @moorereason's awesome differential fuzzing work! This is the last planned pre-release dedicated to the core library. Check out the updated readme for upgrade instructions.
The next milestone is to port the existing tooling (tomljson, tomllint, binary releases) to go-toml v2.
Thank you, and happy holidays!
What's Changed
What's new
- API: Encoder and Decoder options are chainable by @pelletier in #670
- Decoder: show struct field in type mismatch errors by @pelletier in #684
- Encoder: omitempty flag by @pelletier in #692
- Decoder: allow commas in tags by @pelletier in #693
- Decoder: time allows extra precision by @pelletier in #710
- Encode: add comment struct tag by @pelletier in #711
Performance
- Decoder: use lookup table to validate ASCII by @pelletier in #654
- Decode: code cleanup for struct cache by @pelletier in #659
Fixed bugs
- Decode: error on underscore before exponent in floats by @pelletier in #647
- Decode: add missing checks for LocalTime by @pelletier in #650
- Decoder: flag invalid carriage returns in strings by @pelletier in #652
- Decode: correctly handle carriage return in comments by @pelletier in #656
- Decode: prevent comments that look like dates to be accepted by @pelletier in #657
- Decoder: validate inline tables don't redefine keys by @pelletier in #660
- Decoder: validate inline tables in arrays don't redefine keys by @pelletier in #663
- Decode: accept E as exponent notation by @moorereason in #665
- Decoder: prevent duplicates of inline tables by @pelletier in #667
- Decoder: flag invalid carriage returns in literal strings by @moorereason in #673
- Encoder: try to use pointer type TextMarshaler by @pelletier in #679
- Decoder: validate bounds of day and month in dates by @pelletier in #680
- Decoder: fail on unescaped \r not followed by \n by @pelletier in #681
- Decoder: fix panic on table array behind a pointer by @pelletier in #682
- Decoder: flag bad \r in literal multiline strings by @pelletier in #687
- Decoder: check timezones start with +,-,z,Z by @pelletier in #688
- Decoder: check tz has : between hours and minutes by @pelletier in #691
- Decoder: check for invalid characters in timezone by @pelletier in #695
- Decode: restrict timezone offset values by @moorereason in #696
- Decode: ensure signed numbers don't start with an underscore by @moorereason in #698
- Decode: allow maximum seconds value of 60 by @moorereason in #700
- Decode: ensure signed exponents don't start with an underscore by @moorereason in #699
- Decoder: prevent modification of inline tables by @pelletier in #702
- Decoder: disallow modification of existing table by @pelletier in #704
- Decode: fix maximum time offset values by @moorereason in #706
- Decode: allow CRLF as whitespace before line ending backslash by @pelletier in #709
- Decode: fix index panic on integers with just a sign by @moorereason in #716
- Decode: check buffer length before parsing simple key by @moorereason in #717
Documentation
- Encoder: mention "-" to prevent encoding field in doc by @pelletier in #683
- Readme: document more differences with v1 by @pelletier in #712
- Doc: clarify errors returned by Decode by @pelletier in #713
Full Changelog: v2.0.0-beta.4...v2.0.0-beta.5