Skip to content
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

could not import github.com/davegardnerisme/deephash (invalid package name: "") when generating mocks #28

Open
myshkin5 opened this issue May 2, 2022 · 1 comment

Comments

@myshkin5
Copy link
Collaborator

myshkin5 commented May 2, 2022

github.com/davegardnerisme/deephash is a dependency of moqueries. Apparently Go dependency management is getting hung up on the transitive dependency (transitive to the project generating the mocks). Might be caused by the lack of go.mod in deephash (which has no dependencies other that the standard library).

WORKAROUND

$ go get github.com/davegardnerisme/deephash

Then retry generating the mocks.

@myshkin5
Copy link
Collaborator Author

This is most likely caused by repeated calls to the code generator where the newly generated code gets parsed before dependencies are updated. The first code generation works fine but when the subsequent call attempts to parse the new code, it fails because it isn't aware of transitive dependencies yet. In any case the workaround mentioned above seems to do the trick.

In a future release, I plan to add a batch generator that should make this issue less of an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant