testify
testify copied to clipboard
Fix for mockCall.Unset() panic (issue #1236)
Summary
This PR aims to fix #1236. While it's not the pretties fix, it avoids panic
Changes
Within Unset function instead of iterating over an slice and removing items from it at same time, a temporary slice is created, during iteration orginal logic is used to decide if the item should be removed, and if not, item is added to temporary slice.
After iteration temporary slice overrides orginal slice, preventing panic.
Motivation
As library user, I want this function to work.
Related issues
Closes #1236