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