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
encoding/json: allow ",string" with json.Marshaler #6350
Labels
Milestone
Comments
I don't believe we can change the default encoding. If we allow ",string" with json.Marshalers, then you could annotate the *big.Int fields in your struct with ,string and get the result you wanted. Labels changed: added priority-later, go1.3, removed priority-triage. Status changed to Accepted. |
Comment 2 by nix@google.com: Unfortunately it's not my struct, it's ecdsa.PublicKey (for example). The only way I can see to fix it in general would be to add a flag to to the JSON marshaler to make it interoperate with JS clients (such a flag could also affect the serialization of int64 and uint64). Not a pretty solution though. |
How should this work? A JsonMarshaller can return a []byte containing arbitrarily complex valid JSON. I threw together a small-ish sample that attempts to illustrate my concerns. If consensus can be reached about what this program should output, I might would like to contribute code for this issue. http://play.golang.org/p/oQvjnJI5Q4 |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by nix@google.com:
The text was updated successfully, but these errors were encountered: