Skip to content

Failed to find the "go" binary from PATH #971

Closed
@up9cloud

Description

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.15.2 darwin/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.51.1
      e5a624b788d92b8d34d1392e4c4d9789406efe8f
      x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.18.1
  • Run go env to get the go development environment details
    • GO111MODULE=""
      GOARCH="amd64"
      GOBIN=""
      GOCACHE="/Users/ss/Library/Caches/go-build"
      GOENV="/Users/ss/Library/Application Support/go/env"
      GOEXE=""
      GOFLAGS=""
      GOHOSTARCH="amd64"
      GOHOSTOS="darwin"
      GOINSECURE=""
      GOMODCACHE="/Users/ss/go/pkg/mod"
      GONOPROXY=""
      GONOSUMDB=""
      GOOS="darwin"
      GOPATH="/Users/ss/go"
      GOPRIVATE=""
      GOPROXY="https://proxy.golang.org,direct"
      GOROOT="/usr/local/Cellar/go/1.15.2/libexec"
      GOSUMDB="sum.golang.org"
      GOTMPDIR=""
      GOTOOLDIR="/usr/local/Cellar/go/1.15.2/libexec/pkg/tool/darwin_amd64"
      GCCGO="gccgo"
      ...

Share the Go related settings you have added/edited

None.

Describe the bug

Every time I restart vscode, it shows: Failed to find the "go" binary in either。GOROOT() or PATH(/usr/bin:/bin:/usr/sbin:/sbin). Check PATH, or Install Go and reload the window.

It seems the PATH(/usr/bin:/bin:/usr/sbin:/sbin) from the message is not my actual path:

$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
$ which go
/usr/local/bin/go

And if I manually did Developer: reload window once after terminal started, it would work without errors.

Steps to reproduce the behavior:

  1. Clear all settings about go in vscode, make it all defaults
  2. Make sure your executable go not in /usr/bin:/bin:/usr/sbin:/sbin
  3. Add sleep 15 to ~/.bash_profile to make terminal very slow to up
  4. Restart vocode

Screenshots or recordings

Screen Shot 2020-11-27 at 16 24 26

Refs may help:

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions