-
Notifications
You must be signed in to change notification settings - Fork 1
/
all_types.go
71 lines (57 loc) · 1.04 KB
/
all_types.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
// +build ignore
package genx
import "github.com/cheekybits/genny/generic"
type T generic.Type
type (
KT interface{}
VT interface{}
)
type TypeWithKT struct {
K KT
V VT
Call func(k KT) VT
RemoveMe VT // RemoveMe comment
Iface interface{}
}
// MethodWithPtr comment
func (b *TypeWithKT) MethodWithPtr() {
b.K = new(KT)
b.V = new(VT)
}
// MethodWithValue comment
func (b TypeWithKT) MethodWithValue() {
b.K = new(KT)
b.V = new(VT)
}
func DoParam(b *TypeWithKT) {}
func DoRes() *TypeWithKT { return nil }
func DoBoth(b *TypeWithKT) *TypeWithKT { return nil }
func DoStuff(k ...KT) VT {
b := &TypeWithKT{
RemoveMe: nil,
}
return b.Call(k[0])
}
func DoStuffTwo(k ...KT) VT {
var b TypeWithKT
return b.RemoveMe
}
func ReturnVT() VT {
return nil
}
var (
m map[KT]VT
ktCh chan KT
vtCh chan VT
kvCh chan TypeWithKT
ktA [100]KT
vtA [100]VT
a [100]TypeWithKT
ktS []KT
vtS []VT
s []*TypeWithKT
mp map[*TypeWithKT]interface{}
)
func XXX(vs ...interface{}) interface{} {
return vs[0]
}