Skip to content

installation: go get from temporary directory for tools installation can result in picking a different go version when using asdf #757

Closed
@bmalehorn

Description

@bmalehorn

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.50.0
93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.17.2
  • Run go env to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/brianmalehorn/Library/Caches/go-build"
GOENV="/Users/brianmalehorn/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/brianmalehorn/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/brianmalehorn/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/brianmalehorn/.asdf/installs/golang/1.15.2/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/brianmalehorn/.asdf/installs/golang/1.15.2/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/z_/kwdy65dd7p30j4_k3bv5qh_w0000gn/T/go-build124020973=/tmp/go-build -gno-record-gcc-switches -fno-common"

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

  "go.useLanguageServer": true,
  "go.lintTool": "staticcheck",
  "[go]": {
    "editor.codeActionsOnSave": [
      "source.addMissingImports",
      "source.organizeImports"
    ]
  },

Describe the bug

When I open VSCode, it asks to update tools.
All the tool updates fail:

Tools environment: GOPATH=/Users/brianmalehorn/go
Installing 12 tools at /Users/brianmalehorn/go/bin in module mode.
  gocode
  gopkgs
  go-outline
...

Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs FAILED
Installing github.com/ramya-rao-a/go-outline FAILED
...

12 tools failed to install.

gocode: failed to install gocode(github.com/mdempsky/gocode): Error: Command failed: /Users/brianmalehorn/.asdf/shims/go get -v github.com/mdempsky/gocode
go get github.com/mdempsky/gocode: invalid $GOPROXY setting: cannot have comma
 undefined  
gopkgs: failed to install gopkgs(github.com/uudashr/gopkgs/v2/cmd/gopkgs): Error: Command failed: /Users/brianmalehorn/.asdf/shims/go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs: invalid $GOPROXY setting: cannot have comma
 undefined  
go-outline: failed to install go-outline(github.com/ramya-rao-a/go-outline): Error: Command failed: /Users/brianmalehorn/.asdf/shims/go get -v github.com/ramya-rao-a/go-outline
go get github.com/ramya-rao-a/go-outline: invalid $GOPROXY setting: cannot have comma
 undefined  
...

However, in a regular terminal I can run the same commands in a terminal and they work ok:

/Users/brianmalehorn/.asdf/shims/go get -v github.com/mdempsky/gocode
github.com/mdempsky/gocode/internal/lookdot
golang.org/x/tools/go/internal/gcimporter
net/rpc
github.com/mdempsky/gocode/internal/suggest
golang.org/x/tools/go/gcexportdata
github.com/mdempsky/gocode/internal/cache
github.com/mdempsky/gocode/internal/gbimporter
github.com/mdempsky/gocode

I suspect this extension is not running the same version of go / the same settings at the terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions