| 1 |
# Ensure that fixes are applied correctly, in |
| 2 |
# particular when processing duplicate fixes for overlapping packages |
| 3 |
# in the same directory ("p", "p [p.test]", "p_test [p.test]"). |
| 4 |
|
| 5 |
checker -rename -fix -v example.com/p |
| 6 |
stderr applied 8 fixes, updated 3 files |
| 7 |
exit 0 |
| 8 |
|
| 9 |
-- go.mod -- |
| 10 |
module example.com |
| 11 |
go 1.22 |
| 12 |
|
| 13 |
-- p/p.go -- |
| 14 |
package p |
| 15 |
|
| 16 |
func Foo() { |
| 17 |
bar := 12 |
| 18 |
_ = bar |
| 19 |
} |
| 20 |
|
| 21 |
-- p/p_test.go -- |
| 22 |
package p |
| 23 |
|
| 24 |
func InTestFile() { |
| 25 |
bar := 13 |
| 26 |
_ = bar |
| 27 |
} |
| 28 |
|
| 29 |
-- p/p_x_test.go -- |
| 30 |
package p_test |
| 31 |
|
| 32 |
func Foo() { |
| 33 |
bar := 14 |
| 34 |
_ = bar |
| 35 |
} |
| 36 |
|
| 37 |
-- want/p/p.go -- |
| 38 |
package p |
| 39 |
|
| 40 |
func Foo() { |
| 41 |
baz := 12 |
| 42 |
_ = baz |
| 43 |
} |
| 44 |
|
| 45 |
-- want/p/p_test.go -- |
| 46 |
package p |
| 47 |
|
| 48 |
func InTestFile() { |
| 49 |
baz := 13 |
| 50 |
_ = baz |
| 51 |
} |
| 52 |
|
| 53 |
-- want/p/p_x_test.go -- |
| 54 |
package p_test |
| 55 |
|
| 56 |
func Foo() { |
| 57 |
baz := 14 |
| 58 |
_ = baz |
| 59 |
} |