Skip to content

Commit

Permalink
assert: simplify getLen() implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dolmen committed Jul 31, 2023
1 parent a392378 commit 1ca4eaa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 1ca4eaa

Please sign in to comment.