Why GOPATH unhidden directory in $HOME?

Why is the default gopath an unhidden directory dumped in my home folder? With some files my user cannot move/edit? At the very least it should be a hidden directory. Preferably unhidden under .local or .config or .cache or wherever makes more sense than unhidden in the root of $HOME.

I’ve moved it to .go and ‘go env -w GOPATH=$HOME/.go’ but from the sound of ‘go help gopath’ this seems like it could be nullified at anytime.

The GOPATH is a relict from old days, which you used for active development back before modules got finalized. So I think until 1.14ish…

Today it’s indeed not more than a mix of go specific cache and state folders.

I would indeed favour to move it into XDG_DATA_HOME and XDG_CACHE_HOME respectively.

It may be a relic, but many installs that have a go dependency look to GOPATH. Learned just yesterday I hadn’t put my GOPATH everywhere it needed to be when installing kepubify.

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