.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / mvdan.cc / gofumpt@v0.1.0 / 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 var _ interface{
52 }
53
54 func _(struct{
55 })
56
57 var _ = []interface {
58 }{1, 2, 3}
59
60 func _(
61 )
62
63 -- foo.go.golden --
64 package p
65
66 var _ = []int{}
67
68 var _ = []int{}
69
70 var _ = []int{
71         1, 2,
72         3, 4,
73 }
74
75 var _ = []int{
76         1, 2, 3, 4,
77 }
78
79 var _ = [][]string{{
80         "no need for more newlines",
81         "if wrapping a single expression",
82 }}
83
84 var _ = []string{`
85         no need for newlines
86         `, `
87         if no elements are surrounded by newlines
88 `}
89
90 var _ = []struct{ a int }{
91         { // consistent
92                 a: 1,
93         },
94         {
95                 a: 2,
96         },
97         { // inconsistent
98                 a: 3,
99         },
100 }
101
102 var _ = []struct{ a int }{{
103         a: 1,
104 }, {
105         a: 2,
106 }, {
107         a: 3,
108 }}
109
110 var _ interface{}
111
112 func _(struct{})
113
114 var _ = []interface{}{1, 2, 3}
115
116 func _()