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

Did json.Unmarshal change behaviour between 1.13 and 1.15? #46146

Closed
alexec opened this issue May 13, 2021 · 2 comments
Closed

Did json.Unmarshal change behaviour between 1.13 and 1.15? #46146

alexec opened this issue May 13, 2021 · 2 comments

Comments

@alexec
Copy link

alexec commented May 13, 2021

What version of Go are you using (go version)?

v1.13 and v1.15

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

Linux AMB 64.

What did you do?

I unmarshal into an existing object, and the values of a slice within that object get all jumbled up.

json.Unmarshal(data, &pod.Spec)

pod.Spec already exists and contains data.

What did you expect to see?

I'm actually not sure. If feels like the behavior changed, but unmarshalling into an object which already contains data - well I feel like I should expect problems.

What did you see instead?

@alexec alexec changed the title Did json.Unmarshal change between 1.13 and 1.15? Did json.Unmarshal change behaviour between 1.13 and 1.15? May 13, 2021
@magical
Copy link
Contributor

magical commented May 13, 2021

There was a CL targeted for 1.15 that changed the behavior of json.Unmarshal into existing slices, but it was reverted before the final release. See #21092 and #39427 for details. If you are running a beta of 1.15 that could be the cause.

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@golang golang locked and limited conversation to collaborators May 13, 2022
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

4 participants