This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Extract detailed error information #239
Open
Description
Hi there,
I'm currently using mapstructure for an API, to convert a map[string]interface{}
extracted from user inputs into a structure.
The main use-case is working very well, however I would like to generate my own error messages instead of directly using the error returned by the library.
The required information would be:
- which field failed to be converted
- what was the expected type
- what was the type of the field that failed to be converted
From what I've seen, this is currently not easily done with mapstructure.
Do you think it would be possible to find those information after a call to Decode
without having to scan the error message string?
Metadata
Metadata
Assignees
Labels
No labels