Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go installer and/or https://go.dev/doc/install instructions fail to add $HOME/go/bin to PATH #64977

Closed
fredsa opened this issue Jan 5, 2024 · 2 comments

Comments

@fredsa
Copy link

fredsa commented Jan 5, 2024

Go version

go version go1.21.5 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/fredsa/Library/Caches/go-build'
GOENV='/Users/fredsa/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/fredsa/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/fredsa/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/zj/9v0l3b_x25z6yjqfjs_9k6j0002srk/T/go-build4093910643=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

REPRO STEPS:

  1. Download and install go per https://go.dev/doc/install instructions
    • i.e. On M1 macOS Sonoma 14.2.1, download and execute go1.21.5.darwin-arm64.pkg
  2. Verify your go environment works as expected:
    • i.e. Write some go code, successfully compile it with go CLI which was installed in /usr/local/go/bin/go
  3. Install any go command, i.e.
  4. Attempt to use any of these tools:
    • govulcheck: ERROR -bash: govulcheck: command not found
    • staticcheck: ERROR -bash: staticcheck: command not found
  5. Investigate

REQUEST:
Please do at least one of the following:

  1. Update https://go.dev/doc/install to mention the need to add $HOME/go/bin to your $PATH
  2. Fix the installer to automatically add $HOME/go/bin to $PATH
  3. Add diagnostics to go command that warns the user if $HOME/go/bin is not on the path
  4. Add instructions for the user when they go install … software that adds an executable to $HOME/go/bin, to update their path.
  5. Other fix that addresses the $HOME/go/bin path issue

What did you see happen?

ACTUAL:

  1. go env GOPATH returns the path to my $HOME/go/bin
  2. But, $HOME/go/bin has not been added to my $PATH
  3. govulcheck, staticcheck, etc. (which exist in $HOME/go/bin) are not found on the default path
  4. https://go.dev/doc/install does not mention adding $HOME/go/bin to $PATH
  5. https://go.dev/blog/govulncheck, https://staticcheck.dev/docs/getting-started/, etc. do not mention fixing $PATH
  6. https://stackoverflow.com/questions/70098792/go-install-do-i-need-to-manually-update-my-path exists because developers are unsure

What did you expect to see?

EXPECTED:
1.$HOME/go/bin is added to $PATH during installation -or- https://go.dev/doc/install includes instructions to do this manually

@fredsa
Copy link
Author

fredsa commented Jan 5, 2024

Related issues: #44930, #10147, #30770, (and perhaps #45546).

@seankhliao
Copy link
Member

Duplicate of #39531

@seankhliao seankhliao marked this as a duplicate of #39531 Jan 5, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants