Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

difference between source and reflection based output #36

Closed
jmhodges opened this issue May 27, 2016 · 3 comments
Closed

difference between source and reflection based output #36

jmhodges opened this issue May 27, 2016 · 3 comments

Comments

@jmhodges
Copy link
Contributor

jmhodges commented May 27, 2016

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.

@cyberhck
Copy link

no response here?

@balshetzer
Copy link
Collaborator

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.

@codyoss
Copy link
Member

codyoss commented Jan 15, 2020

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.

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

No branches or pull requests

4 participants