MCPcopy Index your code
hub / github.com/AlekSi/pointer / ToByteOrNil

Function ToByteOrNil

pointer_or_nil.go:24–29  ·  view source on GitHub ↗

ToByteOrNil returns a pointer to the passed byte value, or nil, if passed value is a zero value.

(b byte)

Source from the content-addressed store, hash-verified

22
23// ToByteOrNil returns a pointer to the passed byte value, or nil, if passed value is a zero value.
24func ToByteOrNil(b byte) *byte {
25 if b == 0 {
26 return nil
27 }
28 return &b
29}
30
31// ToComplex64OrNil returns a pointer to the passed complex64 value, or nil, if passed value is a zero value.
32func ToComplex64OrNil(c complex64) *complex64 {

Callers 1

TestByteFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestByteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…