mirror of https://github.com/stretchr/testify.git
assert: simplify getLen() implementation
parent
a23f5db224
commit
7a796b8f87
|
@ -736,9 +736,7 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
|
|||
func getLen(x interface{}) (ok bool, length int) {
|
||||
v := reflect.ValueOf(x)
|
||||
defer func() {
|
||||
if e := recover(); e != nil {
|
||||
ok = false
|
||||
}
|
||||
ok = recover() == nil
|
||||
}()
|
||||
return true, v.Len()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue