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
It's not reasonable if the mocked method signature contains varargs. Coz in real method call, people would like to pass in
fixed number of args that will result in a different number error during go test. NumIn is static and fixed based on the method signature no matter how many args passed in. See below:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Go mock is using
reflect.typeOf(method).NumIn()
to verify method's args number match. See the code:mock/gomock/call.go
Line 119 in fcaca4a
It's not reasonable if the mocked method signature contains varargs. Coz in real method call, people would like to pass in
fixed number of args that will result in a different number error during go test. NumIn is static and fixed based on the method signature no matter how many args passed in. See below:
Maybe it should be verified by
len(call.args)
not through reflect.Related issue #94
Beta Was this translation helpful? Give feedback.
All reactions