go
go copied to clipboard
Return struct errors compatible with `encoding/json`
Hi, thanks for this nice project!
It would be really nice if this project would return errors (exactly or wrapping) e.g. json.UnmarshalTypeError
or json.SyntaxError
, for even more compatibility with the stdlib.
Showing the context like this project already does now is still nice, hence I think it's acceptable to return an error wrapping the above mentioned structs and implementing the errors.Is/As
interfaces for equality checking.
I would be happy to contribute this if accepted :+1:
Agree. It's nice to get this implemented. I have to go back to the standard json decoder because of this.
bringing this up 🆙
We were evaluating this library and got excited for 100% compatible drop-in replacement of "encoding/json"
. Unfortunately, we found a lot of cases where that statement doesn't hold up, this being one of them.