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
Currently it's impossible to handle when a toml configuration file contains a typo in the name of an optional key.
I can't check if the value in the unmarshalled struct is empty because it's an optional field.
An empty value is valid.
Suggestion:
Add an option for the go-tomlEncoder, that if enabled makes Unmarshal() return an error when the passed data contains keys that were not unmarshalled into any fields of the passed struct.
The text was updated successfully, but these errors were encountered:
fho
changed the title
Add Option to make Unmarshal return an error if parsed data contains unprocessed keys
Add Option to make Unmarshal() return an error if parsed data contains unprocessed keys
May 9, 2019
Sounds good to me! Thank you. Do you happen to know of any other Go encoding/decoding libs that support that feature? If there are existing "standards" for this feature, would love to follow them to match expectations / lower surprises.
Currently it's impossible to handle when a toml configuration file contains a typo in the name of an optional key.
I can't check if the value in the unmarshalled struct is empty because it's an optional field.
An empty value is valid.
Suggestion:
Add an option for the
go-toml
Encoder
, that if enabled makesUnmarshal()
return an error when the passeddata
contains keys that were not unmarshalled into any fields of the passed struct.The text was updated successfully, but these errors were encountered: