patterngoCritical
Where does go get install packages?
Viewed 0 times
installwherepackagesdoesget
Problem
I've been given instructions to run
Per https://golang.org/doc/code.html#remote it seems it will be installed in
go get which seems to succeed, but it's not clear to me where the package was installed to so I can run an executable from it.Per https://golang.org/doc/code.html#remote it seems it will be installed in
$GOPATH/bin but $GOPATH isn't defined in my shell (though the go get command seems to work fine). Go is installed via Homebrew.Solution
I found the missing clue by running
From that I found the executable in question at
brew info go, which says:==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATHFrom that I found the executable in question at
$HOME/go/bin.Code Snippets
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATHContext
Stack Overflow Q#50633092, score: 117
Revisions (0)
No revisions yet.