NotNil asserts that the specified object is not nil. assert.NotNil(t, err)
(t TestingT, object interface{}, msgAndArgs ...interface{})
| 705 | // |
| 706 | // assert.NotNil(t, err) |
| 707 | func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { |
| 708 | if !isNil(object) { |
| 709 | return true |
| 710 | } |
| 711 | if h, ok := t.(tHelper); ok { |
| 712 | h.Helper() |
| 713 | } |
| 714 | return Fail(t, "Expected value not to be nil.", msgAndArgs...) |
| 715 | } |
| 716 | |
| 717 | // isNil checks if a specified object is nil or not, without Failing. |
| 718 | func isNil(object interface{}) bool { |