Go version
go version go1.23.2 darwin/arm64
Output of go env in your module/workspace:
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/alex/Library/Caches/go-build'
GOENV='/Users/alex/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/alex/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/alex/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.23.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.23.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/alex/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/alex/Code/test-trace-bug/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/lg/kw6gcgh126lf1nw8q7wjssc00000gn/T/go-build2664326740=/tmp/go-build -gno-record-gcc-switches -fno-common'
What did you do?
https://go.dev/play/p/oQEzMhqVvwn
When I added dependency "cloud.google.com/go/storage" (or any other google library that has sub dependency of "golang.org/x/net/trace") + handler func with "GET /", go run panics with error:
panic: pattern "GET /" (registered at /Users/alex/Code/test-trace-bug/main.go:12) conflicts with pattern "/debug/requests" (registered at /Users/alex/go/pkg/mod/golang.org/x/net@v0.29.0/trace/trace.go:130):
GET / matches fewer methods than /debug/requests, but has a more general path pattern
What did you see happen?
output of the go run command with the example program(https://go.dev/play/p/oQEzMhqVvwn)
-> % go run main.go
panic: pattern "GET /" (registered at /Users/alex/Code/test-trace-bug/main.go:12) conflicts with pattern "/debug/requests" (registered at /Users/alex/go/pkg/mod/golang.org/x/net@v0.29.0/trace/trace.go:130):
GET / matches fewer methods than /debug/requests, but has a more general path pattern
goroutine 1 [running]:
net/http.(*ServeMux).register(...)
/opt/homebrew/Cellar/go/1.23.2/libexec/src/net/http/server.go:2797
net/http.HandleFunc({0x1059e1273?, 0x1069f3860?}, 0x0?)
/opt/homebrew/Cellar/go/1.23.2/libexec/src/net/http/server.go:2791 +0x9c
main.main()
/Users/alex/Code/test-trace-bug/main.go:12 +0x50
exit status 2
What did you expect to see?
Expected build to work.
Let me know if this is an error related to x/net/trace or google cloud storage package.
Go version
go version go1.23.2 darwin/arm64
Output of
go envin your module/workspace:What did you do?
https://go.dev/play/p/oQEzMhqVvwn
When I added dependency "cloud.google.com/go/storage" (or any other google library that has sub dependency of "golang.org/x/net/trace") + handler func with "GET /", go run panics with error:
panic: pattern "GET /" (registered at /Users/alex/Code/test-trace-bug/main.go:12) conflicts with pattern "/debug/requests" (registered at /Users/alex/go/pkg/mod/golang.org/x/net@v0.29.0/trace/trace.go:130):GET / matches fewer methods than /debug/requests, but has a more general path patternWhat did you see happen?
output of the go run command with the example program(https://go.dev/play/p/oQEzMhqVvwn)
What did you expect to see?
Expected build to work.
Let me know if this is an error related to x/net/trace or google cloud storage package.