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