Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from karamaru-alpha/update/karamaru/ignore-ren…
…ame-by-default update: ignore assigning the loop variable to another variable by default / add check-alias option
- Loading branch information
Showing
6 changed files
with
75 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package main | ||
|
||
func main() { | ||
for i, v := range []int{1, 2, 3} { | ||
i := i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
_i := i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
v := v // want `The copy of the 'for' variable "v" can be deleted \(Go 1\.22\+\)` | ||
_v := v // want `The copy of the 'for' variable "v" can be deleted \(Go 1\.22\+\)` | ||
a, i := 1, i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
b, _i := 1, i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
c, v := 1, v // want `The copy of the 'for' variable "v" can be deleted \(Go 1\.22\+\)` | ||
d, _v := 1, v // want `The copy of the 'for' variable "v" can be deleted \(Go 1\.22\+\)` | ||
e := false | ||
_, _, _, _, _, _, _, _, _ = i, _i, v, _v, a, b, c, d, e | ||
} | ||
|
||
for i, j := 1, 1; i+j <= 3; i++ { | ||
i := i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
_i := i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
j := j // want `The copy of the 'for' variable "j" can be deleted \(Go 1\.22\+\)` | ||
_j := j // want `The copy of the 'for' variable "j" can be deleted \(Go 1\.22\+\)` | ||
a, i := 1, i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
b, _i := 1, i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
c, j := 1, j // want `The copy of the 'for' variable "j" can be deleted \(Go 1\.22\+\)` | ||
d, _j := 1, j // want `The copy of the 'for' variable "j" can be deleted \(Go 1\.22\+\)` | ||
e := false | ||
_, _, _, _, _, _, _, _, _ = i, _i, j, _j, a, b, c, d, e | ||
} | ||
|
||
for i := range []int{1, 2, 3} { | ||
i := i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
_i := i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
a, i := 1, i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
b, _i := 1, i // want `The copy of the 'for' variable "i" can be deleted \(Go 1\.22\+\)` | ||
c := false | ||
_, _, _, _, _ = i, _i, a, b, c | ||
} | ||
|
||
var t struct { | ||
Bool bool | ||
} | ||
for _, t.Bool = range []bool{true, false} { | ||
t.Bool = t.Bool // NOTE: ignore | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.