You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
panic: cannot create context from nil parent
goroutine 1 [running]:
context.WithValue(0x0, 0x0, 0x4afc80, 0xc0000961f0, 0x4afa40, 0x4e7ae0, 0x0, 0x0)
/usr/local/go-faketime/src/context/context.go:521 +0x187
main.main()
/tmp/sandbox506034916/prog.go:14 +0x77
Program exited: status 2.
This change in behavior was introduced by 0205790. While I agree with the change in principle, I feel like this should have been specifically called out in the release notes for Go 1.15.
Updating context.WithCancel(), context.WithDeadline() and context.WithValue() to panic when they did not in Go 1.14 and prior will likely be a breaking change for users and, I feel, should be a highlighted change for visibility.
The text was updated successfully, but these errors were encountered:
dylan-bourque
changed the title
Breaking change in Go 1.15 not called out in the release notes
context: Breaking change in Go 1.15 not called out in the release notes
Aug 12, 2020
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. This is a new issue introduced in Go 1.15.
What operating system and processor architecture are you using (
go env
)?go env
Output (using the `golang:1.15` Docker image)What did you do?
Run pre-existing code that was passing
nil
as the parent context tocontext.WithValue()
. Minimal example: https://play.golang.org/p/J0Bxux7Bfs6What did you expect to see?
The string "didn't panic" written to standard out
What did you see instead?
This change in behavior was introduced by 0205790. While I agree with the change in principle, I feel like this should have been specifically called out in the release notes for Go 1.15.
Updating
context.WithCancel()
,context.WithDeadline()
andcontext.WithValue()
to panic when they did not in Go 1.14 and prior will likely be a breaking change for users and, I feel, should be a highlighted change for visibility.The text was updated successfully, but these errors were encountered: