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
$ go1.7 version
go version go1.7.6 darwin/amd64
$ go1.8 version
go version go1.8.3 darwin/amd64
$ go-tip version
go version devel +4e7067cde4 Wed Jun 7 02:13:51 2017 +0000 darwin/amd64
What operating system and processor architecture are you using (go env)?
$ cat ./withcontext.go
package main
import (
"context"
"net/http"
)
func main() {
r := &http.Request{}
r.WithContext(context.Background())
}
What did you expect to see?
$ go1.7 run -gcflags="-trimpath=$PWD" ./withcontext.go ; echo $?
0
$ go1.8 run -gcflags="-trimpath=$PWD" ./withcontext.go ; echo $?
0
net/http.Request.WithContext does not document that the URL field must be non-nil, and both Go 1.7 and 1.8 allow WithContext to be called with a nil URL field.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/T4d5HhNoPL
What did you expect to see?
net/http.Request.WithContext does not document that the URL field must be non-nil, and both Go 1.7 and 1.8 allow WithContext to be called with a nil URL field.
What did you see instead?
The text was updated successfully, but these errors were encountered: