You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
Just helped a friend who is newer to Go through getting a mock made.
She wanted it for tests in her current package and so used the "reflection" version of the mockgen command to make them. However, that caused a circular dependency error in her own build because her own package was being imported.
Using the -source variation, however, "fixed" the problem.
The -self_package flag fixes this for real, but we couldn't figure that out from the docs immediately.
The "fix" of using -source came to us first, but that was maybe an accident? If it was an accident, then this ticket is for figuring out if the reflection version can figure out that the destination file will be in the same package.
If it wasn't, then maybe I need to come up with a documentation PR.
The text was updated successfully, but these errors were encountered:
gomock definitely needs better documentation. I had planned to leave this open until that's resolved.
I'm pretty sure that since this issue was filed gomock has been fixed to handle this specific situation correctly but I can't be sure without sample files.
Closing this issue for now, as since this issue was opened a lot has changed, including docs. If there are specific things people would like better explained I would like to create smaller targeted issues.
Just helped a friend who is newer to Go through getting a mock made.
She wanted it for tests in her current package and so used the "reflection" version of the mockgen command to make them. However, that caused a circular dependency error in her own build because her own package was being imported.
Using the
-source
variation, however, "fixed" the problem.The
-self_package
flag fixes this for real, but we couldn't figure that out from the docs immediately.The "fix" of using -source came to us first, but that was maybe an accident? If it was an accident, then this ticket is for figuring out if the reflection version can figure out that the destination file will be in the same package.
If it wasn't, then maybe I need to come up with a documentation PR.
The text was updated successfully, but these errors were encountered: