...
1
2
3
4
5
6 package pkg
7
8 import "io"
9
10
11
12
13 const ExportedConstant = 1
14
15
16 const internalConstant = 2
17
18
19 const (
20
21 ConstOne = 1
22 ConstTwo = 2
23 constThree = 3
24 )
25
26
27 const (
28 constFour = iota
29 ConstFive
30 ConstSix
31 )
32
33
34
35
36 var ExportedVariable = 1
37
38 var ExportedVarOfUnExported unexportedType
39
40
41 var internalVariable = 2
42
43
44 var (
45
46 VarOne = 1
47 VarTwo = 2
48 varThree = 3
49 )
50
51
52 var (
53 varFour = 4
54 VarFive = 5
55 varSix = 6
56 )
57
58
59 func ExportedFunc(a int) bool {
60
61 return true != false
62 }
63
64
65 func internalFunc(a int) bool
66
67
68 type ExportedType struct {
69
70 ExportedField int
71 unexportedField int
72 ExportedEmbeddedType
73 *ExportedEmbeddedType
74 *qualified.ExportedEmbeddedType
75 unexportedType
76 *unexportedType
77 io.Reader
78 error
79 }
80
81
82 func (ExportedType) ExportedMethod(a int) bool {
83 return true != true
84 }
85
86 func (ExportedType) Uncommented(a int) bool {
87 return true != true
88 }
89
90
91 func (ExportedType) unexportedMethod(a int) bool {
92 return true
93 }
94
95 type ExportedStructOneField struct {
96 OnlyField int
97 }
98
99
100
101 const (
102 ExportedTypedConstant ExportedType = iota
103 )
104
105
106 func ExportedTypeConstructor() *ExportedType {
107 return nil
108 }
109
110 const unexportedTypedConstant ExportedType = 1
111
112
113 type ExportedInterface interface {
114
115
116
117
118
119
120
121
122 ExportedMethod()
123 unexportedMethod()
124 io.Reader
125 error
126 }
127
128
129 type unexportedType int
130
131 func (unexportedType) ExportedMethod() bool {
132 return true
133 }
134
135 func (unexportedType) unexportedMethod() bool {
136 return true
137 }
138
139
140 const (
141 ExportedTypedConstant_unexported unexportedType = iota
142 )
143
144 const unexportedTypedConstant unexportedType = 1
145
146
147 const CaseMatch = 1
148 const Casematch = 2
149
150 func ReturnUnexported() unexportedType { return 0 }
151 func ReturnExported() ExportedType { return ExportedType{} }
152
153 const MultiLineConst = `
154 MultiLineString1
155 MultiLineString2
156 MultiLineString3
157 `
158
159 func MultiLineFunc(x interface {
160 MultiLineMethod1() int
161 MultiLineMethod2() int
162 MultiLineMethod3() int
163 }) (r struct {
164 MultiLineField1 int
165 MultiLineField2 int
166 MultiLineField3 int
167 }) {
168 return r
169 }
170
171 var MultiLineVar = map[struct {
172 MultiLineField1 string
173 MultiLineField2 uint64
174 }]struct {
175 MultiLineField3 error
176 MultiLineField2 error
177 }{
178 {"FieldVal1", 1}: {},
179 {"FieldVal2", 2}: {},
180 {"FieldVal3", 3}: {},
181 }
182
183 const (
184 _, _ uint64 = 2 * iota, 1 << iota
185 constLeft1, constRight1
186 ConstLeft2, constRight2
187 constLeft3, ConstRight3
188 ConstLeft4, ConstRight4
189 )
190
191 const (
192 ConstGroup1 unexportedType = iota
193 ConstGroup2
194 ConstGroup3
195 )
196
197 const ConstGroup4 ExportedType = ExportedType{}
198
199 func newLongLine(ss ...string)
200
201 var LongLine = newLongLine(
202 "someArgument1",
203 "someArgument2",
204 "someArgument3",
205 "someArgument4",
206 "someArgument5",
207 "someArgument6",
208 "someArgument7",
209 "someArgument8",
210 )
211
212 type T2 int
213
214 type T1 = T2
215
216 const (
217 Duplicate = iota
218 duplicate
219 )
220
221
222
223
224
225
226
227
228 func ExportedFormattedDoc(a int) bool {
229 return true
230 }
231
232 type ExportedFormattedType struct {
233
234
235
236
237
238
239
240
241 ExportedField int
242 }
243
244 type SimpleConstraint interface {
245 ~int | ~float64
246 }
247
248 type TildeConstraint interface {
249 ~int
250 }
251
252 type StructConstraint interface {
253 struct { F int }
254 }
255
View as plain text