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
Due to #65570 my org wants to disable the coverage redesign in Go 1.22. When doing so via GOEXPERIMENT=nocoverageredesign it results in a panic from flags in different packages seemingly being compiled together.
What did you see happen?
> GOEXPERIMENT=nocoverageredesign go test -v -race -coverpkg=./... -coverprofile=profile.cov ./...
/tmp/go-build4211356336/b001/maina.test flag redefined: a
panic: /tmp/go-build4211356336/b001/maina.test flag redefined: a
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc00014c000, {0x620ed0, 0xc00012a04f}, {0x61fb38, 0x1}, {0x5e6365, 0x6})
/usr/local/go/src/flag/flag.go:1028 +0x54d
flag.(*FlagSet).BoolVar(...)
/usr/local/go/src/flag/flag.go:749
flag.(*FlagSet).Bool(0xc00014c000, {0x61fb38, 0x1}, 0x0, {0x5e6365, 0x6})
/usr/local/go/src/flag/flag.go:762 +0x85
flag.Bool(...)
/usr/local/go/src/flag/flag.go:769
example.com/go122cover/maina.init()
/home/jphillips/devel/go1.22cover/maina/main.go:8 +0x4f
FAIL example.com/go122cover/maina 0.012s
/tmp/go-build4211356336/b096/mainb.test flag redefined: a
panic: /tmp/go-build4211356336/b096/mainb.test flag redefined: a
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc0000bc000, {0x620ed0, 0xc00001413f}, {0x61fb38, 0x1}, {0x5e6365, 0x6})
/usr/local/go/src/flag/flag.go:1028 +0x54d
flag.(*FlagSet).BoolVar(...)
/usr/local/go/src/flag/flag.go:749
flag.(*FlagSet).Bool(0xc0000bc000, {0x61fb38, 0x1}, 0x0, {0x5e6365, 0x6})
/usr/local/go/src/flag/flag.go:762 +0x85
flag.Bool(...)
/usr/local/go/src/flag/flag.go:769
example.com/go122cover/mainb.init()
/home/jphillips/devel/go1.22cover/mainb/main.go:8 +0x4f
FAIL example.com/go122cover/mainb 0.012s
FAIL
What did you expect to see?
Tests running successfully. The same command runs fine in Go 1.21 and 1.22 without GOEXPERIMENT=nocoverageredesign.
> go test -v -race -coverpkg=./... -coverprofile=profile.cov ./...
=== RUN TestHelloWorld
hello, world
--- PASS: TestHelloWorld (0.00s)
PASS
coverage: 0.0% of statements in ./...
ok example.com/go122cover/maina 1.012s coverage: 0.0% of statements in ./...
=== RUN TestHelloWorld
hello, world
--- PASS: TestHelloWorld (0.00s)
PASS
coverage: 0.0% of statements in ./...
ok example.com/go122cover/mainb 1.013s coverage: 0.0% of statements in ./...
The text was updated successfully, but these errors were encountered:
Go version
1.22
Output of
go env
in your module/workspace:What did you do?
Due to #65570 my org wants to disable the coverage redesign in Go 1.22. When doing so via
GOEXPERIMENT=nocoverageredesign
it results in a panic from flags in different packages seemingly being compiled together.What did you see happen?
What did you expect to see?
Tests running successfully. The same command runs fine in Go 1.21 and 1.22 without
GOEXPERIMENT=nocoverageredesign
.The text was updated successfully, but these errors were encountered: