Releases: pelletier/go-toml
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
v2.0.0-beta.4
Almost 5 months after the previous v2.0.0-beta.3 release, this beta version contains a lot of bug fixes, effectively closing all the known issues on v2 so far. It creates a solid foundation on the way to the stable release. Thank you to everybody involved!
What's Changed
What's new
- Provide own implementation of Local* by @pelletier in #558
- Decode: convert ints if target type is compatible by @pelletier in #594
- Decode: support lowercase 'T' and 'Z' in date-time parsing by @moorereason in #601
- Decode: preserve nanosecond precision when decoding time by @moorereason in #626
Performance
Fixed bugs
- Decode: don't panic on recursive structs by @pelletier in #557
- Decode: handle LocalTime to interface{} unmarshal by @kkHAIKE in #567
- Decode: make copy of non addressable values by @pelletier in #576
- Decode: don't crash on unterminated table key by @pelletier in #580
- Decode: fix non-terminated array error by @pelletier in #584
- Decode: don't crash on unterminated inline table by @pelletier in #587
- Decode: fix error reporting for last comments by @pelletier in #591
- Decode: don't overflow when parsing bad times by @pelletier in #593
- Decode: don't panic when date time is missing timezone by @RiyaJohn in #614
- Decode: fail when array is missing separator by @jidicula in #616
- Encode: make floats always contain a decimal point by @zostay in #615
- Decode: validate UTF-8 by @pelletier in #629
- Decode: validate dates by @jidicula in #622
- Encode: Follow RFC3339 spec for LocalTime by @jidicula in #632
- Decode: handle more cases when during float validation by @pelletier in #636
- Decode: Floats and integers parsing fixes by @pelletier in #638
- Decode: check for explicit tables on dotted keys by @pelletier in #639
- Decode: empty document should result in a map by @pelletier in #640
- Decode: don't panic when storing table in slice by @pelletier in #641
- Decode: use UnmarshalText for any type not just structs by @pelletier in #642
- Decode: properly handle multiline strings termination by @pelletier in #643
Documentation
- Add installation instructions by @pelletier in #572
- Update benchmarks results by @pelletier in #630
Other changes
- Go 1.17 release by @pelletier in #574
New Contributors
- @mmorel-35 made their first contribution in #570
- @kkHAIKE made their first contribution in #568
- @zostay made their first contribution in #615
Full Changelog: v2.0.0-beta.3...v2.0.0-beta.4
v1.9.4
Changes:
Checksums
(sha256)
736127ffcf3492efa2f105d2d4be9ce0308c9cdfb4e5091173dc86ae5139fdfd *jsontoml_darwin_amd64.tar.xz
1bffb4ebe0a2ec62dd42e0aac983322f8233c0c80282a0a207ddc882b8165a94 *jsontoml_linux_amd64.tar.xz
2b0a2976e085e492b4f117a59a63c97bca8ffcf21560799862f796dbbd5070ea *jsontoml_windows_amd64.tar.xz
01005a47cd578428ab20a7f4180e785a22f718919b5b74acf26c9c388156d89f *tomljson_darwin_amd64.tar.xz
85076f66a99c8ca9af1dc4a7a6e9403c410e2d382628112f098a151a265ecf69 *tomljson_linux_amd64.tar.xz
e35ae9c4531ec395092b150bf1e9b7c2c5807b0090c596057db27aa890b05225 *tomljson_windows_amd64.tar.xz
8616c17decc105e3b1824e88c4bd94e36c3be4a62a8be28028f21e6c9a82ce97 *tomll_darwin_amd64.tar.xz
216ab1611d22913867eed216c8c0e571938f5ac930aa0ff2ab5ecfdd4290a945 *tomll_linux_amd64.tar.xz
e5f8cca5dc801d3ead054acb5f81cb91953bc89b4793a0a9d9ef8f7aacce59d3 *tomll_windows_amd64.tar.xz
v1.9.3
Changes:
Checksums
(sha256)
27fd76c540501b1e223ecf934d2202ee88d329c0a79318ffebcdbc592d0dce9e *jsontoml_darwin_amd64.tar.xz
6cf6590bfa72f2c5f026d4dfb29fdfa1986d02aa23f36589a5a0f7868e71e0bf *jsontoml_linux_amd64.tar.xz
90e279ced95ed79edd79f933aa8c4f02bfc2762216d9e52e76becff71ab1202d *jsontoml_windows_amd64.tar.xz
122b4ed91a6813f82a1afcf853f80ca53e3427007e9dbb943cbd806d5e4b34c8 *tomljson_darwin_amd64.tar.xz
8eb3dda6198f5f2868098a4f74c1341e63b217e70938e5528bb82a376a0c798c *tomljson_linux_amd64.tar.xz
f05d274070cc4f0d7563521a7e0d1874729bc0c7fa94474c49d9228ad7d6adb0 *tomljson_windows_amd64.tar.xz
a824d7b3fafa61b183e99c434c908b09e42ce6b8c54a1347afec143ccecc9db8 *tomll_darwin_amd64.tar.xz
1ff1b2e0fd057bdd86cd1b203c3b7c158fc3c196b59f2a0bfeee3d65f3ba95d6 *tomll_linux_amd64.tar.xz
be9541829660470139bdb7244b9b0ff0c99aca1bf62465f32f115820cb586155 *tomll_windows_amd64.tar.xz
v2.0.0-beta.3
Work on performance improvement.
Execution time speedup compared to other Go TOML libraries:
Benchmark | go-toml v1 | BurntSushi/toml |
---|---|---|
Marshal/HugoFrontMatter | 2.0x | 2.0x |
Marshal/ReferenceFile/map | 1.8x | 2.0x |
Marshal/ReferenceFile/struct | 2.7x | 2.7x |
Unmarshal/HugoFrontMatter | 3.0x | 2.6x |
Unmarshal/ReferenceFile/map | 3.0x | 3.1x |
Unmarshal/ReferenceFile/struct | 5.9x | 6.6x |
See more
The table above has the results of the most common use-cases. The table below contains the results of all benchmarks, including unrealistic ones. It is provided for completeness.
Benchmark | go-toml v1 | BurntSushi/toml |
---|---|---|
Marshal/SimpleDocument/map | 1.7x | 2.1x |
Marshal/SimpleDocument/struct | 2.6x | 2.9x |
Unmarshal/SimpleDocument/map | 4.1x | 2.9x |
Unmarshal/SimpleDocument/struct | 6.3x | 4.1x |
UnmarshalDataset/example | 3.5x | 2.4x |
UnmarshalDataset/code | 2.2x | 2.8x |
UnmarshalDataset/twitter | 2.8x | 2.1x |
UnmarshalDataset/citm_catalog | 2.3x | 1.5x |
UnmarshalDataset/config | 4.2x | 3.2x |
[Geo mean] | 3.0x | 2.7x |
This table can be generated with ./ci.sh benchmark -a -html
.
v1.9.2
Changes:
Checksums
(sha256)
05d3657a7751ef00957e1c6f225514d32965a781e4d75b9d216a62582c00a90a *jsontoml_darwin_amd64.tar.xz
981e9ebe23fd17008646283e2be806c16c02c55098526c9646e34a2b47138a49 *jsontoml_linux_amd64.tar.xz
c2a30efc65aed2c3ca77eef4c1670fd506dc45016908a7703ea6ae604aefa786 *jsontoml_windows_amd64.tar.xz
da6d15f947d6f73b27c809a7ad4aed24d71618e1524d2378726af1f67963939d *tomljson_darwin_amd64.tar.xz
681ee708616632356a6793a719b72b908808014729c31e04b12d6cdc56064531 *tomljson_linux_amd64.tar.xz
bce5d828b23aad9edc7b95a2b0d41ab95758406048eff3495969478a94bab206 *tomljson_windows_amd64.tar.xz
6404a1fab65ddb02c13ec31aac743de9f8ebde452d23e18af68b0244a3f46912 *tomll_darwin_amd64.tar.xz
5149b82d415fd5bc30c5f4ffc84af51d30b722fdf0d5fec27c76253801318959 *tomll_linux_amd64.tar.xz
2cb87e431404e57a26bf21f46bd5743a079d4537dab0e2430b3e17a34d4adb85 *tomll_windows_amd64.tar.xz
v2.0.0-beta.2
Test coverage of 97.6%. No fundamental change.
v1.9.1
Changes:
Checksums
(sha256)
174ecebbeb95d0b8044933553bbf6326e01258954cfd2771a51884618ae31755 *jsontoml_darwin_amd64.tar.xz
f28f2155d3e1dab449c7ce05b5a1becf45c1132542d8c23d779b4e835b6d65a9 *jsontoml_linux_amd64.tar.xz
fcb5bb97bd427d9f7d6f962f77ade4ae7f8001ce853b0b5dc585ca667529d9cb *jsontoml_windows_amd64.tar.xz
54f3e6ed616ca1de8e160581dc62d0dbc1b9520d7027f68419e9f01d1cab0618 *tomljson_darwin_amd64.tar.xz
af3cad39b40a4d47cb2fb08175d3bb5986d54410837470534d7088c498a763df *tomljson_linux_amd64.tar.xz
77e335c951ce46734fb500488d0d9dd3697a1d3f62529733c8c4d0dc85f0aba5 *tomljson_windows_amd64.tar.xz
f9e35cd578d8c497d34c6708ca680c39d3550117f16a68b961c995758c6fb505 *tomll_darwin_amd64.tar.xz
c208f10b6ff0a9ade1f97c291c2cf86c0308e5d37bb16cf27879bead7cedb349 *tomll_linux_amd64.tar.xz
0e0f961ef0c5866f2852158f05ae01975b46051e24c62490075e02fc1cb09338 *tomll_windows_amd64.tar.xz
v2.0.0-beta.1
Feature parity with v1 for encoding and decoding! Plus some performance improvements and documentation.
v2.0.0-alpha.2
Main addition since v2.0.0-alpha.1 is StrictMode on the Decoder.