Skip to content

Commit 7661620

Browse files
committed
Fix variadic args
1 parent a337434 commit 7661620

File tree

3 files changed

+69
-47
lines changed

3 files changed

+69
-47
lines changed

internal/fixtures/buildtag/comment/mocks_testify_comment_test.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/fixtures/mocks_testify_test_test.go

Lines changed: 66 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mock_testify.templ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func (_c *{{ $ExpecterCallNameInstantiated }}) Run(run func({{ $method.ArgList }
180180
_c.Call.Run(func(args mock.Arguments) {
181181
{{- range $i, $param := $method.Params }}
182182
var arg{{ $i }} {{ $param.TypeString }}
183-
{{- if and $method.IsVariadic (eq ($i) (len $method.Params))}}
183+
{{- if and $method.IsVariadic (eq ($i) (len $method.Params | add -1))}}
184184

185185
{{- $variadicParam := index $method.Params (len $method.Params | add -1) }}
186186
{{- $nonVariadicParams := slice $method.Params 0 (len $method.Params | add -1 )}}

0 commit comments

Comments
 (0)