Blame view

default_values.go 1.03 KB
ad8e9dd2a   Marko Tikvić   added middleware ...
1
  package webutility
707782344   Marko Tikvić   lint; vet
2
  // Int32ValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
3
4
5
6
7
8
  func Int32ValueOrDefault(val *interface{}) (def int32) {
  	if *val != nil {
  		def = (*val).(int32)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
9
  // Int64ValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
10
11
12
13
14
15
  func Int64ValueOrDefault(val *interface{}) (def int64) {
  	if *val != nil {
  		def = (*val).(int64)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
16
  // Uint32ValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
17
18
19
20
21
22
  func Uint32ValueOrDefault(val *interface{}) (def uint32) {
  	if *val != nil {
  		def = (*val).(uint32)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
23
  // Uint64ValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
24
25
26
27
28
29
  func Uint64ValueOrDefault(val *interface{}) (def uint64) {
  	if *val != nil {
  		def = (*val).(uint64)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
30
  // Float32ValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
31
32
33
34
35
36
  func Float32ValueOrDefault(val *interface{}) (def float32) {
  	if *val != nil {
  		def = (*val).(float32)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
37
  // Float64ValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
38
39
40
41
42
43
  func Float64ValueOrDefault(val *interface{}) (def float64) {
  	if *val != nil {
  		return (*val).(float64)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
44
  // StringValueOrDefault ...
ad8e9dd2a   Marko Tikvić   added middleware ...
45
46
47
48
49
50
  func StringValueOrDefault(val *interface{}) (def string) {
  	if *val != nil {
  		def = (*val).(string)
  	}
  	return def
  }
707782344   Marko Tikvić   lint; vet
51