-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkind.go
More file actions
52 lines (47 loc) · 692 Bytes
/
kind.go
File metadata and controls
52 lines (47 loc) · 692 Bytes
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
package validator
import "reflect"
func isIntKind(k reflect.Kind) bool {
switch k {
case
reflect.Int,
reflect.Int8,
reflect.Int16,
reflect.Int32,
reflect.Int64:
return true
}
return false
}
func isUintKind(k reflect.Kind) bool {
switch k {
case
reflect.Uint,
reflect.Uint8,
reflect.Uint16,
reflect.Uint32,
reflect.Uint64,
reflect.Uintptr:
return true
}
return false
}
func isFloatKind(k reflect.Kind) bool {
switch k {
case
reflect.Float32,
reflect.Float64:
return true
}
return false
}
func isLenKind(k reflect.Kind) bool {
switch k {
case
reflect.Array,
reflect.Slice,
reflect.Map,
reflect.String:
return true
}
return false
}