Skip to content

Commit

Permalink
docs: range-val-* rules are irrelevant for Go 1.22+
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored and chavacava committed Nov 12, 2024
1 parent 4c958ef commit 8c274eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions RULES_DESCRIPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -756,13 +756,17 @@ _Description_: Range variables in a loop are reused at each iteration. This rule
_Configuration_: N/A
_Note_: This rule is irrelevant for Go 1.22+.
## range-val-in-closure
_Description_: Range variables in a loop are reused at each iteration; therefore a goroutine created in a loop will point to the range variable with from the upper scope. This way, the goroutine could use the variable with an undesired value.
This rule warns when a range value (or index) is used inside a closure
_Configuration_: N/A
_Note_: This rule is irrelevant for Go 1.22+.
## range
_Description_: This rule suggests a shorter way of writing ranges that do not use the second value.
Expand Down

0 comments on commit 8c274eb

Please # to comment.