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

Use existing dependency code source from the GOPATH #55

Open
yaziine opened this issue Jul 11, 2019 · 4 comments
Open

Use existing dependency code source from the GOPATH #55

yaziine opened this issue Jul 11, 2019 · 4 comments

Comments

@yaziine
Copy link

yaziine commented Jul 11, 2019

gohack should check if the dependency already exists in the GOPATH before cloning it into $HOME/gohack.

Let's say I have github.com/heetch/felice in my GOPATH.

Instead of having:

replace github.com/heetch/felice => $HOME/gohack/github.com/heetch/felice

I would have

replace github.com/heetch/felice => $GOPATH/src/github.com/heetch/felice
@mvdan
Copy link
Collaborator

mvdan commented Jul 11, 2019

Do people still actively use GOPATH when developing code, though? I personally do all of my development in modules nowadays, and I expect GOPATH will be dropped in a couple of Go releases once modules are on by default.

@yaziine
Copy link
Author

yaziine commented Jul 12, 2019

I think that there is still people that didn't move at all to modules.

But maybe if we don't want to take the GOPATH in account anymore we can pass a flag that specifies in which directory to look for before cloning the dependency. What do you think?

@josharian
Copy link
Contributor

Do people still actively use GOPATH when developing code, though?

Old habits die hard.

Also, I sometimes want to download code to poke around at it before I have an actual use for it anywhere. I currently put those things in my GOPATH.

@myitcv
Copy link
Collaborator

myitcv commented Oct 1, 2019

For control over the location of where gohack puts code, set GOHACK.

FWIW - I always find myself doing GOHACK=$(mktemp -d), because more often than not I'm simply poking around code.

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

4 participants