Anyone use $HOME as their $GOPATH?

I was thinking of doing that for convenience. Has anyone had any problems with name collisions?

I always use $HOME as $GOPATH.

I’m using “/tmp/gopath” as my $GOPATH with $GO111MODULE=on and $GOBIN=/usr/local/bin. I think this way is the future. :wink:

So no troubles mixing go stuff with no go stuff in bin or src? awesome.

From my point of view is no problem to have $GOPATH in $HOME. More than this I also use an installer who build the entire Go environment based on $HOME as root for instalation and also for $GOPATH. I guess you shouldn’t make worries, having bin and src folder basically won’t interfere with nothing else.

If you have a mixed environment (let’s say you develop in other languages) can be a good idea to use src (source folder) also for other projects written in other languages (that’s what I’m doing).

Example of my $HOME folder structure (related to Go):

/bin
/go
  /bin
  /src
/src/
  /github.com
    /go_project
    /other_language_project
  /projects
    /go_project
    /other_language_project
  /tests
1 Like

From the Wiki.

FileTreeDocumentation, SettingGOPATH

Thanks <3

Actually, there’s no relevant info there.

…thinking of doing that for convenience

i absolutely think the idea is inconvenient.

Haha I’ve found it very convenient thus far, but it may be an xkcd goto type situation (https://www.xkcd.com/292/). Installing vim-go bloated my ~/bin with a lot of very utilities. I didn’t like vim-go for other reasons so I deleted them, but if something like that ever happens again I’m switching back to ~/go.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.