testify/mock
lisitsky 2b00d33aec
Fix Call.Unset() panic (issue #1236) (#1250)
Unset changes len of a `ExpectedCalls` slice during iteration while using index from original slice, and under some conditions it tries to reslice element beyond of the slice boundaries. That causes panic.

The proposed solution uses independent write index to count elements kept in output slice.

Tests (the simplest and more complicated cases) and comments are included.
2023-01-03 20:44:42 +10:00
..
doc.go Fix most golint warnings 2016-01-09 19:30:22 +01:00
mock.go Fix Call.Unset() panic (issue #1236) (#1250) 2023-01-03 20:44:42 +10:00
mock_test.go Fix Call.Unset() panic (issue #1236) (#1250) 2023-01-03 20:44:42 +10:00