-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone 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.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
golang/go#71952 mentions “later uses”, golang/go#76880 “implicitly used”, but there are at least two ways to use a value via aliasing:
func closure() int {
var i int
f := func() int { return i }
for i = 0; i < 10; i++ {
}
return f()
}
func address() int {
var i int
p := &i
for i = 0; i < 10; i++ {
}
return *p
}Both function return different values when the loop is transformed into a range loop (Go Playground).
modernizer checks for defer (go.dev/cl/701715), but not general uncalled closures or addresses.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone 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.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.