Update module github.com/BurntSushi/toml to v1 #620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.4.1
->v1.0.0
Release Notes
BurntSushi/toml
v1.0.0
Compare Source
This release adds much more detailed errors, support for the
toml.Marshaler
interface, and several fixes.There is no special meaning in the jump to v1.0; the 0.x releases were always treated as if they're 1.x with regards to compatibility; the versioning scheme for this library predates the release of modules.
New features
Error reporting is much improved; the reported position of errors should now always be correct and the library can print more detailed errors (#299, #332)
Decode always return a
toml.ParseError
, which has three methods:Error()
behaves as before and shows a single concise line with the error.ErrorWithPosition()
shows the same error, but also shows the line the error occurred at, similar to e.g. clang or the Rust compiler.ErrorWithUsage()
is the same asErrorWithPosition()
, but may also show a longer usage guidance message. This isn't always present (in which case it behaves identical toErrorWithPosition()
), but it should be present for most common mistakes and sources of confusion.Which error the correct one to use is depends on your application and preferences; in general I would recommend using at least
ErrorWithPosition()
for user-facing errors, as it's much more helpful for users of any skill level. If your users are likely to be non-technical thenErrorWithUsage()
is probably a good idea; I did my best to avoid technical jargon such as "newline" and phrase things in a way that's understandable by most people not intimately familiar with these sort of things.Additionally, the TOML key that fialed should now always be reported in all errors.
Add
toml.Marshaler
interface. This can be used if you want full control over how something is marshalled as TOML, similar tojson.Marshaler
etc. This takes precedence overencoding.TextMarshaler
. (#327)Allow TOML integers to be decoded to a Go float (#325)
Previously
int = 42
could only be decoded to anint*
type; now this can also be decoded in afloat
type as long as it can be represented without loss of data.Fixes
Key.String() is now quoted when needed (#333)
Fix decoding of nested structs on 32bit platforms (#314)
Empty slices are now always
[]T{}
rather than nil, which was the behaviour in v0.3.1 and before. While they are identical for most purposes, encoding/json encodes them different ([]
vs.null
), making it an (accidentally) incompatible change (#339)Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.