Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential conformance issue with encoding/json #1

Open
epelc opened this issue Apr 19, 2020 · 0 comments
Open

Potential conformance issue with encoding/json #1

epelc opened this issue Apr 19, 2020 · 0 comments

Comments

@epelc
Copy link

epelc commented Apr 19, 2020

Hi Quest,

As part of reading through many docs I just noticed a potential issue you might have. UnmarshalJSON is supposed to be a no-op when it encounters null.

https://golang.org/pkg/encoding/json/#Unmarshaler

By convention, to approximate the behavior of Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op.

See second part after || of this line. I believe it should be removed or at least noted.
https://github.com/qhenkart/objectid-go/blob/master/objectid.go#L155

Was very hidden in std lib docs. Think I have to fix a spot or two in my projects also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant