Hacker News new | ask | show | jobs
by acln 3451 days ago
I use GOPATH=$HOME. All the code (Go and other languages) lives under $HOME/src.
1 comments

And what about .git? And roots compatible with what other Devs expect?
I don't see any problems with .git. Most go packages use git anyway, it would be pretty amazing if go tooling would break if you have a .git directory anywhere.

Re the other question: If you don't run a go command with a path name, it doesn't matter what the directory structure is. I have tons of non-go projects in my GOPATH and build them with the usual tools. No issues.

Running

  GOPATH=$HOME go get github.com/foo/bar
would download the package to:

  $HOME/src/github.com/foo/bar
So $HOME will not have .git.
What about git?
I was curious about how this recommendation effects other Devs and the .git and other similar paths in the Dev workflow.

That is, is the root of each go project effected?

Sorry, I don't understand the question.

I also set GOPATH=$HOME, and all my source code (not only Go) lives in $HOME/src, and I do use git for both Go and non-Go projects (so they have a .git directory in $HOME/src/what/ever/.git), and there's no problem. Why would there be one?