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 / std-imports.txt
1 [!gofumpt] skip 'don''t add or remove imports'
2
3 gofumpt -w foo.go
4 cmp foo.go foo.go.golden
5
6 gofumpt -d foo.go.golden
7 ! stdout .
8
9 -- foo.go --
10 package p
11
12 import (
13         "io"
14         "io/ioutil" // if the user keeps them in the top group, obey that
15         _ "io/ioutil"
16
17         _ "image/png"
18
19         "bufio" // the above is for a side effect; this one has a comment
20 )
21
22 import (
23         "os"
24
25         "foo.local/one"
26
27         bytes_ "bytes"
28
29         "io"
30 )
31
32 import (
33         "foo.local/two"
34
35         "fmt"
36 )
37
38 // If they are in order, but with extra newlines, join them.
39 import (
40         "more"
41
42         "std"
43 )
44
45 // We need to split std vs non-std in this case too.
46 import (
47         "foo.local/three"
48         math "math"
49 )
50
51 import (
52         "x"
53         // don't mess up this comment
54         "y"
55         // or many
56         // of them
57         "z"
58 )
59
60 // This used to crash gofumpt, as there's no space to insert an extra newline.
61 import (
62 "std"
63 "non.std/pkg"
64 )
65
66 // All of the extra imports below are known to not belong in std.
67 // For example/ and test/, see https://golang.org/issue/37641.
68 import (
69         "io"
70
71         "example/foo"
72         "internal/bar"
73         "test/baz"
74 )
75 -- foo.go.golden --
76 package p
77
78 import (
79         "io"
80         "io/ioutil" // if the user keeps them in the top group, obey that
81         _ "io/ioutil"
82
83         _ "image/png"
84
85         "bufio" // the above is for a side effect; this one has a comment
86 )
87
88 import (
89         "io"
90         "os"
91
92         "foo.local/one"
93
94         bytes_ "bytes"
95 )
96
97 import (
98         "fmt"
99
100         "foo.local/two"
101 )
102
103 // If they are in order, but with extra newlines, join them.
104 import (
105         "more"
106         "std"
107 )
108
109 // We need to split std vs non-std in this case too.
110 import (
111         math "math"
112
113         "foo.local/three"
114 )
115
116 import (
117         "x"
118         // don't mess up this comment
119         "y"
120         // or many
121         // of them
122         "z"
123 )
124
125 // This used to crash gofumpt, as there's no space to insert an extra newline.
126 import (
127         "std"
128
129         "non.std/pkg"
130 )
131
132 // All of the extra imports below are known to not belong in std.
133 // For example/ and test/, see https://golang.org/issue/37641.
134 import (
135         "io"
136
137         "example/foo"
138         "internal/bar"
139         "test/baz"
140 )