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

allow for overriding source package #529

Closed
wants to merge 2 commits into from

Conversation

choo-stripe
Copy link

Greetings!

We call mockgen from bazel, which lives in a hermetic environment and doesn't have access to go modules or GOPATH. However, we shouldn't really need to magically find the name of the go package.

This PR adds a flag to override the source package - so that if the mock file needs to import from the original file, it'll use the provided package.

I looked at writing tests. I didn't put this in parsePackageImport because that function is called in multiple places, including to determine the destination path. We don't want to override the destination path. I thought about creating a new function, getPackageName or something, but it didn't seem worthwhile.

@codyoss
Copy link
Member

codyoss commented Feb 24, 2021

@choo-stripe Would you please open a feature request for this PR. We like to have discussion before implementing any features.

@choo-stripe
Copy link
Author

Done: #531

@codyoss
Copy link
Member

codyoss commented Apr 16, 2021

Closing in favor of #547

@codyoss codyoss closed this Apr 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants