default_values.go
853 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
package webutility
func Int32ValueOrDefault(val *interface{}) (def int32) {
if *val != nil {
def = (*val).(int32)
}
return def
}
func Int64ValueOrDefault(val *interface{}) (def int64) {
if *val != nil {
def = (*val).(int64)
}
return def
}
func Uint32ValueOrDefault(val *interface{}) (def uint32) {
if *val != nil {
def = (*val).(uint32)
}
return def
}
func Uint64ValueOrDefault(val *interface{}) (def uint64) {
if *val != nil {
def = (*val).(uint64)
}
return def
}
func Float32ValueOrDefault(val *interface{}) (def float32) {
if *val != nil {
def = (*val).(float32)
}
return def
}
func Float64ValueOrDefault(val *interface{}) (def float64) {
if *val != nil {
return (*val).(float64)
}
return def
}
func StringValueOrDefault(val *interface{}) (def string) {
if *val != nil {
def = (*val).(string)
}
return def
}