Skip to content

Commit

Permalink
up: update the fetch variadic param kind logic
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Aug 23, 2022
1 parent 164c4b9 commit d56c71f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ func TestUtil_Func_getVariadicKind(t *testing.T) {
}

for _, item := range noErrTests {
vt := reflect.TypeOf(item.val)
eleType := getVariadicKind(vt.String())
eleType := getVariadicKind(reflect.TypeOf(item.val))
assert.Equal(t, item.want, eleType)
}
}
Expand Down
2 changes: 1 addition & 1 deletion validating.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func convertArgsType(v *Validation, fm *funcMeta, field string, args []interface
// eg. "...int64" -> slice "[]int64"
if fm.isVariadic {
// get variadic kind. "[]int64" -> reflect.Int64
lastTyp = getVariadicKind(ft.In(lastArgIndex).String())
lastTyp = getVariadicKind(ft.In(lastArgIndex))
}

// only one args and type is interface{}
Expand Down

0 comments on commit d56c71f

Please sign in to comment.