-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clearer errors when decoding to invalid types (#332)
When passing an invalid type such as "int" you would get the rather unhelpful message of: toml: cannot load TOML value of type map[string]interface {} into a Go integer This adds an extra check for that, so that you get: toml: cannot decode to type int The second case is when you're using a wrong map type or struct field type, the previous error message was: toml: cannot load TOML value of type bool into a Go integer So what exactly failed? No clue at all. This adds the TOML key: toml: incompatible types: TOML key "F" has type bool; destination has type integer Also clarify the errors for non-pointers and nil a wee bit while I'm here. Fixes #158
- Loading branch information
Showing
2 changed files
with
60 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters