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

cloud.google.com/go/internal/fields fails at go tip #813

Closed
hyangah opened this issue Nov 28, 2017 · 4 comments
Closed

cloud.google.com/go/internal/fields fails at go tip #813

hyangah opened this issue Nov 28, 2017 · 4 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@hyangah
Copy link

hyangah commented Nov 28, 2017

As discussed in golang.org/issue/21357 (golang/go#21357)
json unmarshal will ignore embedded pointers to unexported types in go1.10.
This test is obviously unhappy about it.

\cc @zombiezen @jba @dsnet

$ go version
go version devel +84f941ad4c Mon Nov 27 21:56:05 2017 -0500 darwin/amd64
$ go test
--- FAIL: TestAgainstJSONEncodingNoTags (0.00s)
fields_test.go:151: got
{Exported:1 unexported:0 Shadow:3 embed1:{Em1:4 Dup:0 Shadow:0 embed3:{Em3:0 embed5:{x:0}}} embed2:0xc420095dd0 Anonymous:15}
want
{Exported:1 unexported:0 Shadow:3 embed1:{Em1:4 Dup:5 Shadow:0 embed3:{Em3:7 embed5:{x:0}}} embed2: Anonymous:15}
FAIL
exit status 1
FAIL cloud.google.com/go/internal/fields 0.041s

@jba jba self-assigned this Nov 28, 2017
@jba jba added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Nov 28, 2017
@jba
Copy link
Contributor

jba commented Dec 1, 2017

encoding/json is still broken. I reopened golang/go#21357. Holding off until that is fixed.

@zombiezen
Copy link
Contributor

That issue is now fixed. What remains on this issue?

@dsnet
Copy link
Contributor

dsnet commented Dec 8, 2017

https://code-review.googlesource.com/#/c/20672/ was merged not long ago. I'll need to be imported internally.

@zombiezen
Copy link
Contributor

Marking fixed here and I'll do the cherrypick.

jba added a commit that referenced this issue Jul 12, 2018
DO NOT SUBMIT: test still fails because of bug in encoding/json fix.

As of Go 1.10, a bug in reflect has been fixed, so it is no longer
possible to create pointers to embedded, unexported structs. As a result,
encoding/json's output has changed in these cases. (See golang/go#21357).

We make the same change in our fields package, for consistency.

Fixes #813.

Change-Id: I836ddc6f9c4e8ef9e37643b66f287f2916799c93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

4 participants