You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go's encoding/json's displays errors such as json: cannot unmarshal number into Go struct field Foo.bar of type string.
It would help for go-toml to display similar errors. Currently, the errors are quite vague and make it difficult for users to know where in the config the error is: toml: cannot store TOML integer into a Go string.
The text was updated successfully, but these errors were encountered:
pelletier
changed the title
more helpful errors for mismatched types on struct decoding
More helpful errors for mismatched types on struct decoding
Nov 10, 2021
The goal is to provide some context as to why the type were mismatched. This
change only works for that case, on structs. This is the same a encoding/json. A
more general solution would be great, but this would require a broader change in
the decoder, which I don't think is necessary at the moment.
Fixes#628
The goal is to provide some context as to why the type were mismatched. This
change only works for that case, on structs. This is the same a encoding/json. A
more general solution would be great, but this would require a broader change in
the decoder, which I don't think is necessary at the moment.
Fixes#628
Go's
encoding/json
's displays errors such asjson: cannot unmarshal number into Go struct field Foo.bar of type string
.It would help for go-toml to display similar errors. Currently, the errors are quite vague and make it difficult for users to know where in the config the error is:
toml: cannot store TOML integer into a Go string
.The text was updated successfully, but these errors were encountered: