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 return true != false
61 }
62
63
64 func internalFunc(a int) bool
65
66
67 type ExportedType struct {
68
69 ExportedField int
70 unexportedField int
71 ExportedEmbeddedType
72 *ExportedEmbeddedType
73 *qualified.ExportedEmbeddedType
74 unexportedType
75 *unexportedType
76 io.Reader
77 error
78 }
79
80
81 func (ExportedType) ExportedMethod(a int) bool {
82 return true != true
83 }
84
85 func (ExportedType) Uncommented(a int) bool {
86 return true != true
87 }
88
89
90 func (ExportedType) unexportedMethod(a int) bool {
91 return true
92 }
93
94 type ExportedStructOneField struct {
95 OnlyField int
96 }
97
98
99
100 const (
101 ExportedTypedConstant ExportedType = iota
102 )
103
104
105 func ExportedTypeConstructor() *ExportedType {
106 return nil
107 }
108
109 const unexportedTypedConstant ExportedType = 1
110
111
112 type ExportedInterface interface {
113
114
115
116
117
118
119
120
121 ExportedMethod()
122 unexportedMethod()
123 io.Reader
124 error
125 }
126
127
128 type unexportedType int
129
130 func (unexportedType) ExportedMethod() bool {
131 return true
132 }
133
134 func (unexportedType) unexportedMethod() bool {
135 return true
136 }
137
138
139 const (
140 ExportedTypedConstant_unexported unexportedType = iota
141 )
142
143 const unexportedTypedConstant unexportedType = 1
144
145
146 const CaseMatch = 1
147 const Casematch = 2
148
149 func ReturnUnexported() unexportedType { return 0 }
150 func ReturnExported() ExportedType { return ExportedType{} }
151
152 const MultiLineConst = `
153 MultiLineString1
154 MultiLineString2
155 MultiLineString3
156 `
157
158 func MultiLineFunc(x interface {
159 MultiLineMethod1() int
160 MultiLineMethod2() int
161 MultiLineMethod3() int
162 }) (r struct {
163 MultiLineField1 int
164 MultiLineField2 int
165 MultiLineField3 int
166 }) {
167 return r
168 }
169
170 var MultiLineVar = map[struct {
171 MultiLineField1 string
172 MultiLineField2 uint64
173 }]struct {
174 MultiLineField3 error
175 MultiLineField2 error
176 }{
177 {"FieldVal1", 1}: {},
178 {"FieldVal2", 2}: {},
179 {"FieldVal3", 3}: {},
180 }
181
182 const (
183 _, _ uint64 = 2 * iota, 1 << iota
184 constLeft1, constRight1
185 ConstLeft2, constRight2
186 constLeft3, ConstRight3
187 ConstLeft4, ConstRight4
188 )
189
190 const (
191 ConstGroup1 unexportedType = iota
192 ConstGroup2
193 ConstGroup3
194 )
195
196 const ConstGroup4 ExportedType = ExportedType{}
197
198 func newLongLine(ss ...string)
199
200 var LongLine = newLongLine(
201 "someArgument1",
202 "someArgument2",
203 "someArgument3",
204 "someArgument4",
205 "someArgument5",
206 "someArgument6",
207 "someArgument7",
208 "someArgument8",
209 )
210
211 type T2 int
212
213 type T1 = T2
214
215 const (
216 Duplicate = iota
217 duplicate
218 )
219
220
221
222
223
224
225
226
227 func ExportedFormattedDoc(a int) bool {
228 return true
229 }
230
231 type ExportedFormattedType struct {
232
233
234
235
236
237
238
239 ExportedField int
240 }
241
242 type SimpleConstraint interface {
243 ~int | ~float64
244 }
245
246 type TildeConstraint interface {
247 ~int
248 }
249
250 type StructConstraint interface {
251 struct { F int }
252 }
253
View as plain text