MCPcopy
hub / github.com/duke-git/lancet / IsNil

Function IsNil

pointer/pointer.go:85–87  ·  view source on GitHub ↗

IsNil returns true if the given interface is nil or the underlying value is nil.

(i interface{})

Source from the content-addressed store, hash-verified

83
84// IsNil returns true if the given interface is nil or the underlying value is nil.
85func IsNil(i interface{}) bool {
86 return i == nil || (reflect.ValueOf(i).Kind() == reflect.Ptr && reflect.ValueOf(i).IsNil())
87}

Callers 4

ExampleIsNilFunction · 0.85
OfFunction · 0.85
UnwrapOrFunction · 0.85
ExtractPointerFunction · 0.85

Calls 3

KindMethod · 0.80
ValueOfMethod · 0.45
IsNilMethod · 0.45

Tested by 1

ExampleIsNilFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…