-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeGoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Thinkingmodules
Milestone
Description
Reported by @alexaandru in #63888 (comment)
$ cat go.mod
module example.com/m
go 1.22.0
$ cat main.go
package main
func main() {
for i := range 10 {
go func() { println(i) }()
}
}
No output (as expected) when running as a package:
$ go1.22.0 vet example.com/m
False positive when running on a file:
$ go1.22.0 vet main.go
# command-line-arguments
# [command-line-arguments]
./main.go:5:23: loop variable i captured by func literal
go1.22.0 vet -x -json example.com/m
gives the GoVersion as "GoVersion": "go1.22.0",
. go1.22.0 vet -x -json main.go
gives the GoVersion as "GoVersion": "",
.
smlx, karlskewes and filipviz
Metadata
Metadata
Assignees
Labels
FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeGoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Thinkingmodules