Debian Codegraph @

go/analysis/internal/checker/testdata/conflict.txt

raw
1 # Conflicting edits are legal, so long as they appear in different fixes.
2 # The driver will apply them in some order, and discard those that conflict.
3 #
4 # fix1 appears first, so is applied first; it succeeds.
5 # fix2 and fix3 conflict with it and are rejected.
6
7 checker -marker -fix example.com/a
8 exit 1
9 stderr applied 1 of 3 fixes; 1 file updated...Re-run
10
11 -- go.mod --
12 module example.com
13
14 go 1.22
15
16 -- a/a.go --
17 package a
18
19 func f() {
20 bar := 12 //@ fix1("\tbar", "baz"), fix2("ar ", "baz"), fix3("bar", "lorem ipsum")
21 _ = bar //@ fix1(" bar", "baz")
22 }
23
24 -- want/a/a.go --
25 package a
26
27 func f() {
28 baz := 12 //@ fix1("\tbar", "baz"), fix2("ar ", "baz"), fix3("bar", "lorem ipsum")
29 _ = baz //@ fix1(" bar", "baz")
30 }