Open HassanCehef opened 3 days ago
Also encountering this. For now I just edit the generated code manually but like @HassanCehef said, it is inconvenient and makes it so we cannot generate as part of continuous integration.
I've opened a pull request with a fix for this in #219
Hello. I tried to use this project in v0.5.0 from v0.4.0, and this produced code that doesn't compile anymore. I produced a smaller example here than my real project. I can push a private simplified repo if needs be for full repro.
Actual behavior A clear and concise description of what the bug is.
generating mocks finishes without error, and produces code that does not compile. Instead, when running tests, I'll get a
packagename.WhateverExported is not a type
Expected behavior A clear and concise description of what you expected to happen.
generating mocks finishes without error, and produces code that compiles
To Reproduce Steps to reproduce the behavior
With v0.4.0, we get
with v0.5.0 we have
The solution for my work project is to wait for a fix upstream. A workaround is to rename the variable
DoThat(packagename int) packagename.WhateverExported
=>DoThat(packagename2 int) packagename.WhateverExported
, but it's annoying. A full fix will be to introduce some deterministic aliases to the package imports, making sure that the name is not reused by a parameter name.Additional Information
Triage Notes for the Maintainers
Thanks for maintaining this project.