Closed fr3fou closed 2 years ago
How about:
-p
argument takes an optional /...
suffix to load the entire code tree under that package-e/exclude
flag mutually exclusive to -i
that finds all interfaces and filters out the supplied excluded onesWould that behavior be intuitive to you?
How about:
- Making each
-p
argument takes an optional/...
suffix to load the entire code tree under that package- Making an
-e/exclude
flag mutually exclusive to-i
that finds all interfaces and filters out the supplied excluded onesWould that behavior be intuitive to you?
Yep, that'd be perfect! Really liking the mocks generated from this tool as opposed to https://github.com/vektra/mockery
Assuming those 2 features get implemented, the only issue left I'll have left is somehow avoiding circular dependencies (package foo/
defines an interface for which go-mockgen
generates a mock in mocks/
. If I have a test file inside the same package I end up with a cyclic import error. I managed to resolve it by changing the package name to foo_test
(but still keeping it in the same directory). Is there a way to automatically place the mocks in the same package as they are defined under a, say mocks_test.go
file? The README suggests something along those lines but I'm thinking of something more automatic)
Really liking the mocks generated from this tool
Thank you!
The README suggests something along those lines but I'm thinking of something more automatic)
Would you mind creating a new issue with the expected behavior? As far as I can tell, what you want can be achieved with a combination of existing flags, but you'd like a short-hand/auto-detection for it?
Sorry for the delay, got caught up at $DAYJOB. I'll be handling this issue and #12 by early next week.
Is there a way to disable mocking of a specific interface (I want every interface in a given package, but one)
Slightly unrelated but is there a way to recursively search for interfaces? Something like
go-mockgen github.com/foo/bar/baz/...