testutil: don't panic on AssertNil on non-nil errors
@@ -54,5 +54,9 @@ func AssertFalse(t *testing.T, v bool, msg ...string) {
}
func isNil(v interface{}) bool {
- return v == nil || reflect.ValueOf(v).IsNil()
+ if v == nil {
+ return true
+ }
+ rv := reflect.ValueOf(v)
+ return rv.Kind() != reflect.Struct && rv.IsNil()
}
