-
Notifications
You must be signed in to change notification settings - Fork 22
/
copygen.go
356 lines (291 loc) · 9.68 KB
/
copygen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
// Code generated by github.com/switchupcb/copygen
// DO NOT EDIT.
// Package copygen contains the setup information for copygen generated code.
package copygen
import (
"github.com/switchupcb/copygen/examples/_tests/multi/complex"
"github.com/switchupcb/copygen/examples/_tests/multi/external"
)
// Placeholder represents a basic type.
type Placeholder bool
// Collection represents a type that holds collection field types.
// empty represents a struct that contains an empty struct.
// freefloat serves the purpose of checking for free-floating comments.
type freefloat struct {
A string
}
type Collection struct {
Arr [16]byte
S []string
M map[string]bool
C chan int
I error
F func() int
}
type empty struct {
e struct{}
}
// NoMatchBasic copies a Placeholder to a Placeholder.
func NoMatchBasic(tP Placeholder, fP Placeholder) {
// Placeholder fields
}
// NoMatchBasicExternal copies a *Placeholder to a external.Placeholder, *external.Placeholder, bool.
func NoMatchBasicExternal(tP external.Placeholder, tP1 *external.Placeholder, tb bool, fP *Placeholder) {
// external.Placeholder fields
// *external.Placeholder fields
// bool fields
}
// NoMatchArraySimple copies a [16]byte to a Collection.
func NoMatchArraySimple(tC Collection, fb [16]byte) {
// Collection fields
}
// NoMatchSliceSimple copies a []string to a Collection.
func NoMatchSliceSimple(tC Collection, fs []string) {
// Collection fields
}
// NoMatchMap copies a map[string]bool to a Collection.
func NoMatchMap(tC Collection, fm map[string]bool) {
// Collection fields
}
// NoMatchChan copies a chan int to a Collection.
func NoMatchChan(tC Collection, fc chan int) {
// Collection fields
}
// NoMatchInterface copies a error to a Collection.
func NoMatchInterface(tC Collection, fe error) {
// Collection fields
}
// NoMatchInterfaceAlias copies a interface{func() string; } to a *Collection.
func NoMatchInterfaceAlias(tC *Collection, fi interface{ func() string }) {
// *Collection fields
}
// NoMatchFunc copies a func() int to a Collection.
func NoMatchFunc(tC Collection, ff func() int) {
// Collection fields
}
// NoMatchExternal copies a []external.Collection to a []external.Collection.
func NoMatchExternal(te []external.Collection, fe []external.Collection) {
// []external.Collection fields
}
// Basic copies a bool to a bool.
func Basic(tb bool, fb bool) {
// bool fields
tb = fb
}
// BasicPointer copies a bool to a *bool.
func BasicPointer(tb *bool, fb bool) {
// *bool fields
tb = &fb
}
// BasicDoublePointer copies a *bool to a **bool.
func BasicDoublePointer(tb **bool, fb *bool) {
// **bool fields
tb = &fb
}
// BasicSimple copies a Placeholder to a Placeholder.
func BasicSimple(tP Placeholder, fP Placeholder) {
// Placeholder fields
tP = fP
}
// BasicSimplePointer copies a Placeholder to a *Placeholder.
func BasicSimplePointer(tP *Placeholder, fP Placeholder) {
// *Placeholder fields
tP = &fP
}
// BasicPointerMulti copies a *Placeholder to a *Placeholder, *Placeholder, string.
func BasicPointerMulti(tP *Placeholder, tP1 *Placeholder, ts string, fP *Placeholder) {
// *Placeholder fields
tP = fP
// *Placeholder fields
// string fields
}
// BasicExternal copies a *external.Placeholder to a external.Placeholder.
func BasicExternal(tP external.Placeholder, fP *external.Placeholder) {
// external.Placeholder fields
tP = *fP
}
// BasicExternalMulti copies a *external.Placeholder to a external.Placeholder, *external.Placeholder.
func BasicExternalMulti(tP external.Placeholder, tP1 *external.Placeholder, fP *external.Placeholder) {
// external.Placeholder fields
tP = *fP
// *external.Placeholder fields
tP1 = fP
}
// Array copies a [16]byte to a [16]byte.
func Array(tb [16]byte, fb [16]byte) {
// [16]byte fields
tb = fb
}
// ArraySimple copies a [16]byte to a *Collection.
func ArraySimple(tC *Collection, fb [16]byte) {
// *Collection fields
tC.Arr = fb
}
// ArrayExternal copies a [16]external.Placeholder to a [16]external.Placeholder.
func ArrayExternal(te [16]external.Placeholder, fe [16]external.Placeholder) {
// [16]external.Placeholder fields
te = fe
}
// ArrayComplex copies a [16]map[byte]string to a *complex.Collection.
func ArrayComplex(tC *complex.Collection, fm [16]map[byte]string) {
// *complex.Collection fields
tC.Arr = fm
}
// ArrayExternalComplex copies a [16]map[*external.Collection]string to a *complex.ComplexCollection.
func ArrayExternalComplex(tC *complex.ComplexCollection, fm [16]map[*external.Collection]string) {
// *complex.ComplexCollection fields
tC.Arr = fm
}
// Slice copies a []string to a []string.
func Slice(ts []string, fs []string) {
// []string fields
ts = fs
}
// SlicePointer copies a []*int to a []*int.
func SlicePointer(ti []*int, fi []*int) {
// []*int fields
ti = fi
}
// SliceSimple copies a []string to a *Collection.
func SliceSimple(tC *Collection, fs []string) {
// *Collection fields
tC.S = fs
}
// SliceExternal copies a []external.Placeholder to a []external.Placeholder.
func SliceExternal(te []external.Placeholder, fe []external.Placeholder) {
// []external.Placeholder fields
te = fe
}
// SliceComplex copies a []map[string][16]int to a *complex.Collection.
func SliceComplex(tC *complex.Collection, fm []map[string][16]int) {
// *complex.Collection fields
tC.S = fm
}
// SliceExternalComplex copies a []map[string]func(*external.Collection) string to a *complex.ComplexCollection.
func SliceExternalComplex(tC *complex.ComplexCollection, fm []map[string]func(*external.Collection) string) {
// *complex.ComplexCollection fields
tC.S = fm
}
// Map copies a map[string]bool to a map[string]bool.
func Map(tm map[string]bool, fm map[string]bool) {
// map[string]bool fields
tm = fm
}
// MapSimple copies a map[string]bool to a *Collection.
func MapSimple(tC *Collection, fm map[string]bool) {
// *Collection fields
tC.M = fm
}
// MapExternal copies a map[string]external.Placeholder to a map[string]external.Placeholder.
func MapExternal(tm map[string]external.Placeholder, fm map[string]external.Placeholder) {
// map[string]external.Placeholder fields
tm = fm
}
// MapComplex copies a map[string]interface{func() string; } to a *complex.Collection.
func MapComplex(tC *complex.Collection, fm map[string]interface{ func() string }) {
// *complex.Collection fields
tC.M = fm
}
// MapExternalComplex copies a map[*external.Collection]external.Placeholder to a *complex.ComplexCollection.
func MapExternalComplex(tC *complex.ComplexCollection, fm map[*external.Collection]external.Placeholder) {
// *complex.ComplexCollection fields
tC.M = fm
}
// Chan copies a chan int to a chan int.
func Chan(tc chan int, fc chan int) {
// chan int fields
tc = fc
}
// ChanSimple copies a chan int to a *Collection.
func ChanSimple(tC *Collection, fc chan int) {
// *Collection fields
tC.C = fc
}
// ChanExternal copies a chan external.Placeholder to a chan external.Placeholder.
func ChanExternal(tc chan external.Placeholder, fc chan external.Placeholder) {
// chan external.Placeholder fields
tc = fc
}
// ChanComplex copies a chan *[]int to a *complex.Collection.
func ChanComplex(tC *complex.Collection, fc chan *[]int) {
// *complex.Collection fields
tC.C = fc
}
// ChanExternalComplex copies a chan *[]external.Collection to a complex.ComplexCollection.
func ChanExternalComplex(tC complex.ComplexCollection, fc chan *[]external.Collection) {
// complex.ComplexCollection fields
tC.C = fc
}
// Interface copies a interface{} to a interface{}.
func Interface(ti interface{}, fi interface{}) {
// interface{} fields
ti = fi
}
// InterfaceSimple copies a error to a *Collection.
func InterfaceSimple(tC *Collection, fe error) {
// *Collection fields
tC.I = fe
}
// InterfaceExternal copies a error to a *external.Collection.
func InterfaceExternal(tC *external.Collection, fe error) {
// *external.Collection fields
tC.I = fe
}
// InterfaceComplex copies a interface{func(rune) *int; } to a *complex.Collection.
func InterfaceComplex(tC *complex.Collection, fi interface{ func(rune) *int }) {
// *complex.Collection fields
tC.I = fi
}
// InterfaceExternalComplex copies a interface{func(string) map[*external.Collection]bool; func() (int, byte); } to a complex.ComplexCollection.
func InterfaceExternalComplex(tC complex.ComplexCollection, fi interface {
func(string) map[*external.Collection]bool
func() (int, byte)
}) {
// complex.ComplexCollection fields
tC.I = fi
}
// Func copies a func() int to a func() int.
func Func(tf func() int, ff func() int) {
// func() int fields
tf = ff
}
// FuncSimple copies a func() int to a *Collection.
func FuncSimple(tC *Collection, ff func() int) {
// *Collection fields
tC.F = ff
}
// FuncExternal copies a func(external.Placeholder) int to a func(external.Placeholder) int.
func FuncExternal(tf func(external.Placeholder) int, ff func(external.Placeholder) int) {
// func(external.Placeholder) int fields
tf = ff
}
// FuncComplex copies a func([]string, uint64) *byte to a *complex.Collection.
func FuncComplex(tC *complex.Collection, ff func([]string, uint64) *byte) {
// *complex.Collection fields
tC.F = ff
}
// FuncExternalComplex copies a func(external.Collection) []string to a *complex.ComplexCollection.
func FuncExternalComplex(tC *complex.ComplexCollection, ff func(external.Collection) []string) {
// *complex.ComplexCollection fields
tC.F = ff
}
// EmptyStruct copies a struct{} to a empty.
func EmptyStruct(te empty, fs struct{}) {
// empty fields
te.e = fs
}
// Struct copies a Collection to a Collection.
func Struct(tC Collection, fC Collection) {
// Collection fields
tC = fC
}
// StructExternal copies a external.Collection to a *Collection.
func StructExternal(tC *Collection, fC external.Collection) {
// *Collection fields
tC.Arr = fC.Arr
tC.S = fC.S
tC.M = fC.M
tC.C = fC.C
tC.I = fC.I
tC.F = fC.F
}