MCPcopy
hub / github.com/expr-lang/expr / NotZero

Function NotZero

internal/testify/assert/assertions.go:1678–1686  ·  view source on GitHub ↗

NotZero asserts that i is not the zero value for its type.

(t TestingT, i interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1676
1677// NotZero asserts that i is not the zero value for its type.
1678func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool {
1679 if h, ok := t.(tHelper); ok {
1680 h.Helper()
1681 }
1682 if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) {
1683 return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...)
1684 }
1685 return true
1686}
1687
1688// FileExists checks whether a file exists in the given path. It also fails if
1689// the path points to a directory or there is an error when trying to check the file.

Callers 5

NotZeroFunction · 0.92
NotZerofFunction · 0.70
TestNotZeroFunction · 0.70
TestDiffRaceFunction · 0.70
NotZeroMethod · 0.70

Calls 4

SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45
ZeroMethod · 0.45

Tested by 2

TestNotZeroFunction · 0.56
TestDiffRaceFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…