New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"atomic redeclared as imported package name" build error #27
Comments
Just hit that, too. @msoap as a workaround you can use a named import like this:
|
Thanks for jumping onto this @hexdigest. Unfortunately, the fix doesn't work for me. Here's how to reproduce the issue:
While reproducing the issue I've noticed another issue: |
These are different issues actually. In your case both packages "github.com/gbrlsnchs/jwt/v3" and "example.com/example/i27/jwt" have same identifier which is "jwt". What minimock does is it includes all imports from the original file into the destination file and hope that goimports will fix imports which is not happening here because packages have same id and there there are references to "jwt" id in the generated code. I'll think what I can do here. As a workaround you can try using an alias for "github.com/gbrlsnchs/jwt/v3" |
I must have misunderstood the original ticket then. I thought it was about having The workaround I suggested earlier works in this case, too - that's exactly what I was doing when I first saw this ticket. As for the proper fix, I guess implementing some logic for generating aliases would be the only way to go... |
Thanks @hexdigest! |
@hexdigest thank you, now it works fine. |
Hi,
great tool:), but is not working with interfaces with
.../atomic
types like"go.uber.org/atomic"
.For example for interface:
minimock generates mock:
which produce build error:
The text was updated successfully, but these errors were encountered: