diff options
Diffstat (limited to 'utils/pointers.go')
-rw-r--r-- | utils/pointers.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/pointers.go b/utils/pointers.go new file mode 100644 index 00000000..9c192279 --- /dev/null +++ b/utils/pointers.go @@ -0,0 +1,15 @@ +package utils + +func AsUint64Ptr(val uint64) *uint64 { + if val == 0 { + val = 10 + } + return &val +} + +func AsStringPtr(val string) *string { + if val == "" { + return nil + } + return &val +} |