Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / mvdan.cc / gofumpt@v0.0.0-20200802201014-ab5a8192947d / testdata / scripts / composite-multiline.txt
1 gofumpt -w foo.go
2 cmp foo.go foo.go.golden
3
4 gofumpt -d foo.go.golden
5 ! stdout .
6
7 -- foo.go --
8 package p
9
10 var _ = []int{}
11
12 var _ = []int{
13 }
14
15 var _ = []int{1, 2,
16         3, 4}
17
18 var _ = []int{
19         1, 2, 3, 4}
20
21 var _ = [][]string{{
22         "no need for more newlines",
23         "if wrapping a single expression",
24 }}
25
26 var _ = []string{`
27         no need for newlines
28         `, `
29         if no elements are surrounded by newlines
30 `}
31
32 var _ = []struct{ a int }{
33         { // consistent
34                 a: 1,
35         },
36         {
37                 a: 2,
38         }, { // inconsistent
39                 a: 3,
40         },
41 }
42
43 var _ = []struct{ a int }{{
44         a: 1,
45 }, {
46         a: 2,
47 }, {
48         a: 3,
49 }}
50
51 -- foo.go.golden --
52 package p
53
54 var _ = []int{}
55
56 var _ = []int{}
57
58 var _ = []int{
59         1, 2,
60         3, 4,
61 }
62
63 var _ = []int{
64         1, 2, 3, 4,
65 }
66
67 var _ = [][]string{{
68         "no need for more newlines",
69         "if wrapping a single expression",
70 }}
71
72 var _ = []string{`
73         no need for newlines
74         `, `
75         if no elements are surrounded by newlines
76 `}
77
78 var _ = []struct{ a int }{
79         { // consistent
80                 a: 1,
81         },
82         {
83                 a: 2,
84         },
85         { // inconsistent
86                 a: 3,
87         },
88 }
89
90 var _ = []struct{ a int }{{
91         a: 1,
92 }, {
93         a: 2,
94 }, {
95         a: 3,
96 }}