Skip to content
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
@Turanic

Description

@Turanic

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions