diff --git a/assert/assertions.go b/assert/assertions.go index dc3db36..3a80032 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -765,11 +765,11 @@ func ElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface } // Mark indexes in bValue that we already used - visited := make([]bool, bValue.Len()) - for i := 0; i < aValue.Len(); i++ { + visited := make([]bool, bLen) + for i := 0; i < aLen; i++ { element := aValue.Index(i).Interface() found := false - for j := 0; j < bValue.Len(); j++ { + for j := 0; j < bLen; j++ { if visited[j] { continue }