matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
2k stars 127 forks source link

Variadic args are causing an issue with returning a slice #99

Closed pehowell closed 4 years ago

pehowell commented 5 years ago

If you have a variadic method that returns a slice, such as:

MultiSearch(ctx context.Context, searchTerms ...string) []string

moq tries to convert the return slice into a variadic parameter:

MutiSearchFunc func(ctx context.Context, searchTerms ...string) ...string

which results in a go/format error, for example:

go/format: 52:79: expected type, found '...' (and 8 more errors)

I will submit a pull request shortly with a fix and test for returning slices that catches this issue.

Also, I just want to say thanks for moq!

sudo-suhas commented 4 years ago

Closed via #126