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
{{ message }}
Repository navigation
x/tools/go/analysis/passes/stdversion, cmd/vet: stdversion check refers to "rand.(*Rand).N" method as "rand.N" #80363
$ cat <(echo -- go.mod --) go.mod <(echo -- main.go --) main.go
-- go.mod --
module test
go 1.25.0
-- main.go --
package main
import ("fmt";"math/rand/v2")
func main() {
r := rand.New(rand.NewChaCha8([32]byte{1, 2, 3}))
fmt.Println(r.N(100), "bottles of ...")
}
$ GOTOOLCHAIN=go1.26.5 go run .# test
./main.go:7:19: r.N undefined (type *rand.Rand has no field or method N)
$ ~/gotip/bin/go vet # local gotip with a newer x/tools/internal/stdlib vendored
main.go:7:19: rand.N requires go1.27 or later (file is go1.25)
main.go:7:19: rand.N requires go1.27 or later (file is go1.25)
This symbol name is incorrect, it should be rand.(*Rand).N.
Activity
dmitshur commentedon Jul 10, 2026
It looks like this isn't a regression related to generic methods, rather it's how this check displays methods in general:
gabyhelp commentedon Jul 10, 2026
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
gopherbot commentedon Jul 10, 2026
Change https://go.dev/cl/799600 mentions this issue:
go/analysis/passes/stdversion: correctly format symbol namesgo/analysis/passes/stdversion: correctly format symbol names
gopherbot commentedon Jul 14, 2026
Change https://go.dev/cl/800620 mentions this issue:
[internal-branch.go1.27-vendor] go/analysis/passes/stdversion: correctly format symbol names[internal-branch.go1.27-vendor] go/analysis/passes/stdversion: correc…
gopherbot commentedon Jul 14, 2026
Change https://go.dev/cl/798502 mentions this issue:
cmd/vet: improve how stdversion analyzer refers to methodscmd/vet: improve how stdversion analyzer refers to methods
cmd/vet: improve how stdversion analyzer refers to methods