-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgen-converters.go
77 lines (70 loc) · 1.16 KB
/
gen-converters.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
// This file was automatically generated by genny.
// Any changes will be lost if this file is regenerated.
// see https://github.com/cheekybits/genny
package gonetmap
func ifaceTOInt(i interface{}) int {
var idx int
switch i := i.(type) {
case int:
idx = int(i)
case int16:
idx = int(i)
case int32:
idx = int(i)
case int64:
idx = int(i)
case uint:
idx = int(i)
case uint16:
idx = int(i)
case uint32:
idx = int(i)
case uint64:
idx = int(i)
}
return idx
}
func ifaceTOUint16(i interface{}) uint16 {
var idx uint16
switch i := i.(type) {
case int:
idx = uint16(i)
case int16:
idx = uint16(i)
case int32:
idx = uint16(i)
case int64:
idx = uint16(i)
case uint:
idx = uint16(i)
case uint16:
idx = uint16(i)
case uint32:
idx = uint16(i)
case uint64:
idx = uint16(i)
}
return idx
}
func ifaceTOUint32(i interface{}) uint32 {
var idx uint32
switch i := i.(type) {
case int:
idx = uint32(i)
case int16:
idx = uint32(i)
case int32:
idx = uint32(i)
case int64:
idx = uint32(i)
case uint:
idx = uint32(i)
case uint16:
idx = uint32(i)
case uint32:
idx = uint32(i)
case uint64:
idx = uint32(i)
}
return idx
}