Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore 'implicit memory aliasing' rule for Go 1.22+ #1108

Merged

Conversation

VirrageS
Copy link
Contributor

After the recent changes in language in Go 1.22 we no longer need to check for "implicit memory aliasing" rule. Doing:

for _, item := range items {
	cpItem = &item
	break
}

is now valid because item is a new variable in memory for every iteration (and not as it was before the same variable in memory what caused all the problems).

Closes: #1090

Signed-off-by: Janusz Marcinkiewicz <januszm@nvidia.com>
didrocks added a commit to ubuntu/adsys that referenced this pull request Feb 22, 2024
The loopclosure is not released in gosec yet. This can be removed once
securego/gosec#1108 is merged.
@ccojocar ccojocar merged commit f25ccd9 into securego:master Mar 4, 2024
5 of 6 checks passed
@SuperSandro2000
Copy link

Can you do a release, so that this gets updated in golangci-lint?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

G601 should not be raised when GOEXPERIMENT=loopvar is enabled
3 participants