matryer / moq

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

Allow using goImport as source for moqs #213

Open K4L1Ma opened 7 months ago

K4L1Ma commented 7 months ago

This pull request enables the utilization of goImport as a source for generating mocks. It enhances the flexibility and usability of the package by allowing developers to seamlessly create mocks from external dependencies, specifically those imported using goImport.

relates to https://github.com/matryer/moq/issues/79

this

moq -out snsapi_mocks_test.go -pkg mypkg $(go list -f '{{.Dir}}' github.com/aws/aws-sdk-go-v2/service/sns/snsiface) SNSAPI

can now be generated as

moq -out snsapi_mocks_test.go -pkg mypkg github.com/aws/aws-sdk-go-v2/service/sns/snsiface SNSAPI