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

Comments

Projects
None yet
3 participants
@kanekv
Copy link

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

This comment has been minimized.

Copy link
Member

commented Feb 26, 2016

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

@bradfitz bradfitz closed this Feb 26, 2016

@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.
You can’t perform that action at this time.