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

Function ToComplex128OrNil

pointer_or_nil.go:40–45  ·  view source on GitHub ↗

ToComplex128OrNil returns a pointer to the passed complex128 value, or nil, if passed value is a zero value.

(c complex128)

Source from the content-addressed store, hash-verified

38
39// ToComplex128OrNil returns a pointer to the passed complex128 value, or nil, if passed value is a zero value.
40func ToComplex128OrNil(c complex128) *complex128 {
41 if c == 0 {
42 return nil
43 }
44 return &c
45}
46
47// ToErrorOrNil returns a pointer to the passed error value, or nil, if passed value is a zero value.
48func ToErrorOrNil(e error) *error {

Callers 1

TestComplex128Function · 0.85

Calls

no outgoing calls

Tested by 1

TestComplex128Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…