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
|
// Copyright © 2014 Steve Francia <spf@spf13.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package cast
import "time"
func ToBool(i interface{}) bool {
v, _ := ToBoolE(i)
return v
}
func ToTime(i interface{}) time.Time {
v, _ := ToTimeE(i)
return v
}
func ToDuration(i interface{}) time.Duration {
v, _ := ToDurationE(i)
return v
}
func ToFloat64(i interface{}) float64 {
v, _ := ToFloat64E(i)
return v
}
func ToInt64(i interface{}) int64 {
v, _ := ToInt64E(i)
return v
}
func ToInt(i interface{}) int {
v, _ := ToIntE(i)
return v
}
func ToString(i interface{}) string {
v, _ := ToStringE(i)
return v
}
func ToStringMapString(i interface{}) map[string]string {
v, _ := ToStringMapStringE(i)
return v
}
func ToStringMapStringSlice(i interface{}) map[string][]string {
v, _ := ToStringMapStringSliceE(i)
return v
}
func ToStringMapBool(i interface{}) map[string]bool {
v, _ := ToStringMapBoolE(i)
return v
}
func ToStringMap(i interface{}) map[string]interface{} {
v, _ := ToStringMapE(i)
return v
}
func ToSlice(i interface{}) []interface{} {
v, _ := ToSliceE(i)
return v
}
func ToBoolSlice(i interface{}) []bool {
v, _ := ToBoolSliceE(i)
return v
}
func ToStringSlice(i interface{}) []string {
v, _ := ToStringSliceE(i)
return v
}
func ToIntSlice(i interface{}) []int {
v, _ := ToIntSliceE(i)
return v
}
|