gosec
gosec copied to clipboard
G601 should not be raised when GOEXPERIMENT=loopvar is enabled
Summary
The underlying issue will be fixed in Go 1.22 and is available in Go 1.21 with the GOEXPERIMENT=loopvar
flag enabled
Steps to reproduce the behavior
for _, item := range items {
cpItem = &item
break
}
gosec version
whatever is included in the latest golang-ci
Go version (output of 'go version')
go version go1.21.0 linux/amd64