Zero asserts that i is the zero value for its type.
(t TestingT, i interface{}, msgAndArgs ...interface{})
| 1756 | |
| 1757 | // Zero asserts that i is the zero value for its type. |
| 1758 | func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |
| 1759 | if h, ok := t.(tHelper); ok { |
| 1760 | h.Helper() |
| 1761 | } |
| 1762 | if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { |
| 1763 | return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) |
| 1764 | } |
| 1765 | return true |
| 1766 | } |
| 1767 | |
| 1768 | // NotZero asserts that i is not the zero value for its type. |
| 1769 | func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |