diff options
author | Jay Conrod <jayconrod@google.com> | 2019-06-13 19:56:37 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-06-17 17:28:00 +0000 |
commit | 530097fe60c3d9feffabf52ea910bf35af9da6fb (patch) | |
tree | 2b7eca3228c33e7114619f16a1e740462974e2dd /src/cmd/go/internal/work/build.go | |
parent | 7a4d02387fa16cd2a88c30357346e5cf0ae282b1 (diff) | |
download | go-530097fe60c3d9feffabf52ea910bf35af9da6fb.tar.gz go-530097fe60c3d9feffabf52ea910bf35af9da6fb.zip |
cmd/go: document GOBIN and 'go install' locations
* In doc/install-source.html, clarify the meaning of $GOBIN and
describe where executables from the Go distribution are
installed. Also describe $GOPATH, since it provides a default value
for $GOBIN and may conflict with $GOROOT.
* Add more detail to 'go help install' as well.
Fixes #31576
Change-Id: Ib8a8c21677c3aa0ebef97a3b587b6f8fe338b80e
Reviewed-on: https://go-review.googlesource.com/c/go/+/182341
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/work/build.go')
-rw-r--r-- | src/cmd/go/internal/work/build.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index 9c03f0818d..ed5a149da3 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -404,6 +404,15 @@ var CmdInstall = &base.Command{ Long: ` Install compiles and installs the packages named by the import paths. +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. Executables in $GOROOT +are installed in $GOROOT/bin or $GOTOOLDIR instead of $GOBIN. + +When module-aware mode is disabled, other packages are installed in the +directory $GOPATH/pkg/$GOOS_$GOARCH. When module-aware mode is enabled, +other packages are built and cached but not installed. + The -i flag installs the dependencies of the named packages as well. For more about the build flags, see 'go help build'. |