Closed thierry-f-78 closed 2 years ago
Sorry for the wait! I think that's a reasonable change. I am a little worried about the loss of information for a programmer who would be implementing unmarshaling for their own types, but at that point they probably know where the issue may be coming from. Feel free to open a PR!
Describe the bug
I use go-toml to parse a configuration file. The parsing errors are shown by a system administrator and not by a developper.
I implement a Marshaller to Unmarshal some type (time.Duration in example). When my duration is wring, I read this message:
The administrator read an error strating by "error calling UnmarshalText", but this string is related to program internal behavior. The administrator dont care about this information. This information could be perturbated by this information and could contact software support.
To Reproduce
https://go.dev/play/p/6YvcBbolsFu
Expected behavior
I suggest when the marshaller return a error, the error is reported as-is (without prefix).
If you're ok, I could write a PR
Versions