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