You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
In mock version 1.6, PR #558 added check to compare the function arguments and log if it mismatches. This is causing problems in which the variadic (...) argument in the function is counted as a fixed argument.
func test(b ...interface{}) {}
func main() {
typ := reflect.TypeOf(test)
fmt.Printf("NumIn: %d", typ.NumIn()) // this prints NumIn: 1
}
Due to this, if the Do function is called without any arguments, the function will fail due to arguments mismatch, even though the no argument behavior is expected.
Expected behavior
Ignore variadic argument when counting expected function arguments. Note: This issue was not seen in 1.5. Most probably PR #558 caused this.