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