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