testify
testify copied to clipboard
mock: simplify implementation of FunctionalOptions
Summary
Remove unnecessary use of reflect in the implementation of mock.FunctionalOptions().
Changes
- Change the internal representation of
FunctionalOptionsArgumentto be a slice of arguments to match the variadic argument ofFunctionalOptions. - Remove unnecessary use of
reflect.
Motivation
- Simpler code
- Runtime speed
@snirye Could you review this change as you are a mock.FunctionalOptions user?
@nbaztec Could you review this change as you wrote the initial implementation?
Rebased (with conflict resolution) after merge of f1b5324b903e87676e98b4fa3a5e2fbe2c7dddc5 (#1433).
@dolmen can this be merged? I'm hoping to unblock 1578.