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

Method IsNil

structs/field.go:61–68  ·  view source on GitHub ↗

IsNil returns true if the given field is nil value.

()

Source from the content-addressed store, hash-verified

59
60// IsNil returns true if the given field is nil value.
61func (f *Field) IsNil() bool {
62 v := f.Value()
63 if v == nil || (reflect.ValueOf(v)).Kind() == reflect.Ptr && reflect.ValueOf(v).IsNil() {
64 return true
65 }
66
67 return false
68}
69
70// Name returns the name of the given field
71// Play: https://go.dev/play/p/zfIGlqsatee

Callers 13

InterfaceSliceFunction · 0.45
cloneArrayMethod · 0.45
cloneMapMethod · 0.45
clonePtrMethod · 0.45
ToStringFunction · 0.45
ToStdBase64Function · 0.45
ToUrlBase64Function · 0.45
ToRawStdBase64Function · 0.45
ToRawUrlBase64Function · 0.45
IsZeroValueFunction · 0.45
setStructFieldFunction · 0.45
IsNilFunction · 0.45

Calls 3

ValueMethod · 0.95
KindMethod · 0.80
ValueOfMethod · 0.45

Tested by

no test coverage detected