Skip to content

Commit 87998ee

Browse files
committed
Added new ptr type
1 parent b4937b5 commit 87998ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/types/ptr.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ func PtrUint64(v *uint64) uint64 {
3333
return *v
3434
}
3535

36+
// PtrInt64 returns a int64 from a pointer
37+
func PtrInt64(v *int64) int64 {
38+
if v == nil {
39+
return 0
40+
}
41+
return *v
42+
}
43+
3644
// PtrBool returns a bool from a pointer
3745
func PtrBool(v *bool) bool {
3846
if v == nil {

0 commit comments

Comments
 (0)