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: addErrorContext is not called for errors from UnmarshalJSON #29327

Closed
linniksa opened this issue Dec 18, 2018 · 5 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@linniksa
Copy link

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

go version go1.11.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What did you do?

run code like this https://play.golang.org/p/NLNoBEmLMwr

What did you expect to see?

'type'

What did you see instead?

''

In go 1.10 this code return 'type'

@bradfitz
Copy link
Contributor

Seems fixed at tip (in Go 1.12).

bradfitz@gdev:~$ GOROOT=$HOME/go1.10 go run x.go
'type'
bradfitz@gdev:~$ GOROOT=$HOME/go1.11 go run x.go
''
bradfitz@gdev:~$ GOROOT=$HOME/go go run x.go
'type'

@mvdan, you recall whether this was fixed recently?

Worth a backport to Go 1.11.x?

@bradfitz bradfitz changed the title addErrorContext is not called for errors from UnmarshalJSON encoding/json: addErrorContext is not called for errors from UnmarshalJSON Dec 18, 2018
@bradfitz bradfitz added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 18, 2018
@bradfitz bradfitz added this to the Go1.11.5 milestone Dec 18, 2018
@mvdan
Copy link
Member

mvdan commented Dec 19, 2018

@bradfitz I'm pretty sure this was #27464. I suggested a backport there, but forgot to follow up on that. I do think we should backport, as it's a regression in 1.11, even if a small one in an edge case.

@bradfitz
Copy link
Contributor

@mvdan, thanks. Want to verify, close this one, and request that gopherbot do the cherry-pick?

@mvdan
Copy link
Member

mvdan commented Dec 19, 2018

Yes, this issue is a duplicate, so we can just backport #27464. Happy to help with the backport itself or its review.

@mvdan
Copy link
Member

mvdan commented Dec 20, 2018

Done the above, so I'm closing this issue as a duplicate.

@mvdan mvdan closed this as completed Dec 20, 2018
@mvdan mvdan removed this from the Go1.11.5 milestone Dec 27, 2018
@golang golang locked and limited conversation to collaborators Dec 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants