With recent changes to go install, we now have an official, module-aware
way to locally build and install Go tools. This is a great step, but
I wonder if some renewed consideration should be made to where the tools
are installed.

As I'm sure you all know, go install puts binaries in $GOPATH/bin or
$HOME/go/bin by default. I think that made more sense in a world where the
GOPATH was our primary means of Go development. However, with modules, I
would argue that GOPATH is becoming less and less a part of the Go
development experience. If go install placed binaries in ~/.local/bin by
default instead, it would be more in line with the way other local
installation tools work and wouldn't require users to update their $PATH at
all on some distributions. If we want to keep $GOPATH/bin, perhaps the tool
could put a symlink in ~/.local/bin instead.

I can think of a few reasons why this might not be a good idea:

What about other platforms, like Windows? I don't know if there's a place
in all operating systems where user-installed binaries are supposed to be
installed. It could be argued that the current approach is a better
cross-platform default.

Can't this already be achieved by setting $GOBIN? Sure. I still think
there's value in having the best possible default, but having $GOBIN as an
option makes this discussion less important.

Is this worth the confusion that changes like this inevitably create? Maybe
not. For those of us that use Go daily and already have $GOPATH/bin in our
$PATH, this may seem especially frivlious. I think a change like this
benefits those who don't develop in Go the most, and non-Go developers will
(probably) always outnumber Go developers :)

I'm curious to hear everyone's thoughts.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA%3DXfu0c4x5nW80jVehUs666iv%2B_9xp0frEudZH1u5zBHEm%2BjQ%40mail.gmail.com.

Reply via email to