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

Comments

Projects
None yet
3 participants
@linniksa
Copy link

commented Dec 18, 2018

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

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

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 this to the Go1.11.5 milestone Dec 18, 2018

@mvdan

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Dec 19, 2018

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

@mvdan

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Dec 20, 2018

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

@mvdan mvdan closed this Dec 20, 2018

@mvdan mvdan removed this from the Go1.11.5 milestone Dec 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.