Zero asserts that i is the zero value for its type.
(t TestingT, i interface{}, msgAndArgs ...interface{})
| 1665 | |
| 1666 | // Zero asserts that i is the zero value for its type. |
| 1667 | func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |
| 1668 | if h, ok := t.(tHelper); ok { |
| 1669 | h.Helper() |
| 1670 | } |
| 1671 | if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { |
| 1672 | return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) |
| 1673 | } |
| 1674 | return true |
| 1675 | } |
| 1676 | |
| 1677 | // NotZero asserts that i is not the zero value for its type. |
| 1678 | func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |