1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-17 20:57:58 +02:00

docs: range-val-* rules are irrelevant for Go 1.22+

This commit is contained in:
Oleksandr Redko 2024-11-12 13:35:38 +02:00 committed by chavacava
parent 4c958ef739
commit 8c274eb700

View File

@ -756,6 +756,8 @@ _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.
@ -763,6 +765,8 @@ 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.