-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfloat64.go
More file actions
31 lines (26 loc) · 731 Bytes
/
float64.go
File metadata and controls
31 lines (26 loc) · 731 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
package pointerhelpers
// Float64Helper contains all Float64 related
// pointer helpers
type Float64Helper struct {
}
// Float64 returns a pointer to the float64 value passed in.
func Float64(v float64) *float64 {
return &v
}
// Float64 returns a pointer to the float64 value passed in.
func (i *Float64Helper) Float64(v float64) *float64 {
return Float64(v)
}
// Float64Value returns the value of the float64 pointer passed in or
// 0 if the pointer is nil.
func Float64Value(v *float64) float64 {
if v != nil {
return *v
}
return 0
}
// Float64Value returns the value of the float64 pointer passed in or
// 0 if the pointer is nil.
func (i *Float64Helper) Float64Value(v *float64) float64 {
return Float64Value(v)
}