MCPcopy
hub / github.com/connectrpc/connect-go / NotNil

Function NotNil

internal/assert/assert.go:63–70  ·  view source on GitHub ↗

NotNil asserts that the value isn't nil.

(tb testing.TB, got any, options ...Option)

Source from the content-addressed store, hash-verified

61
62// NotNil asserts that the value isn't nil.
63func NotNil(tb testing.TB, got any, options ...Option) bool {
64 tb.Helper()
65 if !isNil(got) {
66 return true
67 }
68 report(tb, got, nil, "assert.NotNil", false /* showWant */, options...)
69 return false
70}
71
72// Zero asserts that the value is its type's zero value.
73func Zero[T any](tb testing.TB, got T, options ...Option) bool {

Calls 2

isNilFunction · 0.85
reportFunction · 0.85