mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
759 B
759 B
Find Executables Installed By Go
When you install an executable using go install, it puts that executable in
the bin directory designated by the GOBIN environment variable. If that env
var isn't set, then it falls back to one of $GOPATH/bin or $HOME/go/bin.
When I run go help install, it tells me as much:
Executables are installed in the directory named by the GOBIN environment
variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH
environment variable is not set.
So, if I am to install something like tern,
$ go install github.com/jackc/tern/v2@latest
it is going to place that binary in ~/go/bin for me.
$ which tern
/Users/jbranchaud/go/bin/tern