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

Go "exported loop pointer" example is outdated #212

Open
josharian opened this issue Jun 28, 2024 · 1 comment
Open

Go "exported loop pointer" example is outdated #212

josharian opened this issue Jun 28, 2024 · 1 comment

Comments

@josharian
Copy link

Go finally fixed the language to make https://github.com/getgrit/stdlib/blob/main/.grit/patterns/go/exported_loop_pointer.md unnecessary--see https://go.dev/blog/loopvar-preview. So assuming go.mod is >= 1.22, probably the right fix is to find and remove all x := x instances. :)

Not sure whether GritQL supports conditioning on the go.mod version.

@morgante
Copy link
Contributor

We don't support conditioning on go.mod versions currently. Since the rule isn't applied automatically we could probably just make a (different) parallel rule to remove the x := x instances.

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

No branches or pull requests

2 participants