Skip to content

Commit

Permalink
fix: unnecessary trailing , on mock.Call
Browse files Browse the repository at this point in the history
The `m.mock.Call()` invocation was generating a trailing comma with no arguments after it for methods with no parameters.
  • Loading branch information
adamconnelly committed Nov 30, 2023
1 parent e241b33 commit 49a2d52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/kelpie/mock.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Instance struct {
{{- range $method := .Methods }}

func (m *Instance) {{ $method.Name }}({{ template "parameterWithTypeList" $method.Parameters }}){{ if $method.Results }} ({{ template "resultWithTypeList" $method.Results }}){{ end }} {
expectation := m.mock.Call("{{ $method.Name }}", {{ template "parameterList" $method.Parameters }})
expectation := m.mock.Call("{{ $method.Name }}"{{ if $method.Parameters }}, {{ template "parameterList" $method.Parameters }}{{ end }})
if expectation != nil {
if expectation.ObserveFn != nil {
observe := expectation.ObserveFn.({{ template "observationCallback" $method }})
Expand Down
2 changes: 1 addition & 1 deletion examples/mocks/accountservice/accountservice.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 49a2d52

Please sign in to comment.