MCPcopy
hub / github.com/stretchr/testify / isNil

Function isNil

assert/assertions.go:718–734  ·  view source on GitHub ↗

isNil checks if a specified object is nil or not, without Failing.

(object interface{})

Source from the content-addressed store, hash-verified

716
717// isNil checks if a specified object is nil or not, without Failing.
718func isNil(object interface{}) bool {
719 if object == nil {
720 return true
721 }
722
723 value := reflect.ValueOf(object)
724 switch value.Kind() {
725 case
726 reflect.Chan, reflect.Func,
727 reflect.Interface, reflect.Map,
728 reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
729
730 return value.IsNil()
731 }
732
733 return false
734}
735
736// Nil asserts that the specified object is nil.
737//

Callers 3

copyExportedFieldsFunction · 0.85
NotNilFunction · 0.85
NilFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected