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

encoding/json: Marshal doesn't use newEncodeState #14530

Closed
kanekv opened this issue Feb 26, 2016 · 1 comment
Closed

encoding/json: Marshal doesn't use newEncodeState #14530

kanekv opened this issue Feb 26, 2016 · 1 comment

Comments

@kanekv
Copy link

kanekv commented Feb 26, 2016

Is it possible to use newEncodeState in json.Marshal like json Encoder does?

https://golang.org/src/encoding/json/encode.go?h=newEncodeState#L138

@bradfitz bradfitz changed the title json.Marshal doesn't use newEncodeState encoding/json: Marshal doesn't use newEncodeState Feb 26, 2016
@bradfitz
Copy link
Contributor

No, because in Marshal the memory returned is owned by the caller, so we can't reuse it.

@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants