ToByteOrNil returns a pointer to the passed byte value, or nil, if passed value is a zero value.
(b byte)
| 22 | |
| 23 | // ToByteOrNil returns a pointer to the passed byte value, or nil, if passed value is a zero value. |
| 24 | func 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. |
| 32 | func ToComplex64OrNil(c complex64) *complex64 { |