mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
testutil: don't panic on AssertNil on non-nil errors
This commit is contained in:
parent
877d0ce469
commit
1fc300ecbd
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user