-
Notifications
You must be signed in to change notification settings - Fork 13
/
helpers.go
47 lines (38 loc) · 1.3 KB
/
helpers.go
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package csproto
// Bool returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Bool(v bool) *bool {
return &v
}
// Int returns a pointer to v as an int32 value (for use when assigning pointer fields on Protobuf message types)
func Int(v int) *int32 {
p := int32(v)
return &p
}
// Int32 returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Int32(v int32) *int32 {
return &v
}
// Int64 returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Int64(v int64) *int64 {
return &v
}
// Uint32 returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Uint32(v uint32) *uint32 {
return &v
}
// Uint64 returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Uint64(v uint64) *uint64 {
return &v
}
// Float32 returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Float32(v float32) *float32 {
return &v
}
// Float64 returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func Float64(v float64) *float64 {
return &v
}
// String returns a pointer to v (for use when assigning pointer fields on Protobuf message types)
func String(v string) *string {
return &v
}