Skip to content

Commit

Permalink
[fix] 如果函数最后是可变个数参数,忽略参数个数检测
Browse files Browse the repository at this point in the history
  • Loading branch information
sydnash committed May 5, 2019
1 parent d4e266a commit 93ee275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func HelperFunctionToUseReflectCall(f reflect.Value, callParam []reflect.Value,
isVariadic := f.Type().IsVariadic()
for i := 0; i < n; i++ {
paramIndex := i + startNum
if paramIndex >= f.Type().NumIn() {
if !isVariadic && paramIndex >= f.Type().NumIn() {
panic(fmt.Sprintf("InvocationCausedPanic(%v): called param count(%v) is len than reciver function's parma count(%v)", f.Type().String(), len(callParam), f.Type().NumIn()))
}
var expectedType reflect.Type
Expand Down

0 comments on commit 93ee275

Please sign in to comment.