Mockery v3 Generates invalid code for private types
Description
I have a package with a private interface and types My configuration is set to generate the mocks on a different package name Mockery will generate the mock for the private interface and reference a private type, which is invalid
Expected behavior
Either:
- Configurable option to ignore private interfaces / types
- Mockery detects mocks are generated on a different package and ignores private interfaces / types
Mockery version
v3
Installation Mechanism
- [x]
go get - [] Pre-built release
- [] homebrew
- [] Other: [please describe]
You can fix this by just excluding such interfaces that you know of using exclude-interface-regex. I know that's not ideal, but it would work. Your idea of having mockery detect such invalid cases is a good one, I'd be interested to hear more proposals on what this would look like in a concrete sense.
@LandonTClipp I pushed a draft. I'm not happy with some parts, like built-in detection, but it solves the issue for me.
It's not ready to be merged, I'm just showing you the problem.
If you want, we can iterate over it.