NotNil asserts that the specified object is not nil. assert.NotNil(t, err)
(t TestingT, object interface{}, msgAndArgs ...interface{})
| 671 | // |
| 672 | // assert.NotNil(t, err) |
| 673 | func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { |
| 674 | if !isNil(object) { |
| 675 | return true |
| 676 | } |
| 677 | if h, ok := t.(tHelper); ok { |
| 678 | h.Helper() |
| 679 | } |
| 680 | return Fail(t, "Expected value not to be nil.", msgAndArgs...) |
| 681 | } |
| 682 | |
| 683 | // isNil checks if a specified object is nil or not, without Failing. |
| 684 | func isNil(object interface{}) bool { |
searching dependent graphs…