MCPcopy Create free account
hub / github.com/AlekSi/pointer / ToInt64OrNil

Function ToInt64OrNil

pointer_or_nil.go:104–109  ·  view source on GitHub ↗

ToInt64OrNil returns a pointer to the passed int64 value, or nil, if passed value is a zero value.

(i int64)

Source from the content-addressed store, hash-verified

102
103// ToInt64OrNil returns a pointer to the passed int64 value, or nil, if passed value is a zero value.
104func ToInt64OrNil(i int64) *int64 {
105 if i == 0 {
106 return nil
107 }
108 return &i
109}
110
111// ToRuneOrNil returns a pointer to the passed rune value, or nil, if passed value is a zero value.
112func ToRuneOrNil(r rune) *rune {

Callers 1

TestInt64Function · 0.85

Calls

no outgoing calls

Tested by 1

TestInt64Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…