testify icon indicating copy to clipboard operation
testify copied to clipboard

mock: simplify implementation of FunctionalOptions

Open dolmen opened this issue 1 year ago • 4 comments

Summary

Remove unnecessary use of reflect in the implementation of mock.FunctionalOptions().

Changes

  • Change the internal representation of FunctionalOptionsArgument to be a slice of arguments to match the variadic argument of FunctionalOptions.
  • Remove unnecessary use of reflect.

Motivation

  • Simpler code
  • Runtime speed

dolmen avatar Mar 07 '24 13:03 dolmen

@snirye Could you review this change as you are a mock.FunctionalOptions user?

dolmen avatar Mar 22 '24 13:03 dolmen

@nbaztec Could you review this change as you wrote the initial implementation?

dolmen avatar Mar 22 '24 13:03 dolmen

Rebased (with conflict resolution) after merge of f1b5324b903e87676e98b4fa3a5e2fbe2c7dddc5 (#1433).

dolmen avatar Apr 23 '24 13:04 dolmen

@dolmen can this be merged? I'm hoping to unblock 1578.

andrewwillette avatar Jun 08 '24 18:06 andrewwillette