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 / short-case.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 func f(r rune) {
11         switch r {
12         case 'a',
13                 'b',
14                 'c':
15
16         case 'd', 'e', 'f':
17
18         case 'a', 'b',
19                 'c':
20
21         case 'v', 'e', 'r', 'y', 'l', 'o', 'n', 'g',
22                 'l', 'i', 's', 't', '.', '.', '.':
23
24         // before
25         case 'a',
26                 'b': // inline
27                 // after
28
29         case 'a', // middle
30                 'b':
31
32         case 'a', 'b', 'c', 'd', 'e', 'f',
33                 'g': // very very long inline comment at the end
34
35         case 'a', 'b', 'c',
36                 'd': // short comment
37         }
38         {
39                 {
40                         {
41                                 {
42                                         {
43                                                 switch r {
44                                                 case 'i', 'n', 'd', 'e',
45                                                         'n', 't', 'e', 'd':
46                                                 }
47                                         }
48                                 }
49                         }
50                 }
51         }
52 }
53 -- foo.go.golden --
54 package p
55
56 func f(r rune) {
57         switch r {
58         case 'a', 'b', 'c':
59
60         case 'd', 'e', 'f':
61
62         case 'a', 'b', 'c':
63
64         case 'v', 'e', 'r', 'y', 'l', 'o', 'n', 'g',
65                 'l', 'i', 's', 't', '.', '.', '.':
66
67         // before
68         case 'a', 'b': // inline
69                 // after
70
71         case 'a', // middle
72                 'b':
73
74         case 'a', 'b', 'c', 'd', 'e', 'f',
75                 'g': // very very long inline comment at the end
76
77         case 'a', 'b', 'c', 'd': // short comment
78         }
79         {
80                 {
81                         {
82                                 {
83                                         {
84                                                 switch r {
85                                                 case 'i', 'n', 'd', 'e',
86                                                         'n', 't', 'e', 'd':
87                                                 }
88                                         }
89                                 }
90                         }
91                 }
92         }
93 }