I agree, lets change this proposal to make the default $GOPATH$XDG_DATA_HOME/go because $XDG_DATA_HOME is for user specific essential data. It'll be safer like you said.
So I would probably go like that. Sadly the proposal got rejected.
The alternative for me could be:
Things like
2fa
are installed by Go into~/go/bin
. That's pretty ugly.Found a proposal. @nhooyr commented on Jul 23, 2018:
So I would probably go like that. Sadly the proposal got rejected. The alternative for me could be:
GOPATH
=>~/.local/go