What version of Go, VS Code & VS Code Go extension are you using?
- Run
go version to get version of Go
- go version go1.14.2 darwin/amd64
- Run
code -v or code-insiders -v to get version of VS Code or VS Code Insiders
- 1.47.3 91899dcef7b8110878ea59626991a18c8a6a1b3e x64
- Check your installed extensions to get the version of the VS Code Go extension
- Run
go env to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/mgood/Projects/shift/s0/0_build.noindex/_tools/gopath/bin"
GOCACHE="/Users/mgood/Library/Caches/go-build"
GOENV="/Users/mgood/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/mgood/Projects/shift/s0/backend:/Users/mgood/Projects/shift/s0/0_build.noindex/_tools/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/mgood/Projects/shift/s0/0_build.noindex/_tools/go/1.14.2/darwin_amd64/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/mgood/Projects/shift/s0/0_build.noindex/_tools/go/1.14.2/darwin_amd64/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/nf/p50y7t694t1c531kd_zqv8n40000gp/T/go-build979188391=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
"go.gopath": "${workspaceRoot}/backend:${workspaceRoot}/0_build.noindex/_tools/gopath",
"go.goroot": "${workspaceRoot}/0_build.noindex/_tools/go/current",
"go.toolsgopath": "~/.shift/vscode/go_tools",
Describe the bug
In versions 0.14.4 and earlier, the ${workspaceRoot} variable in the goroot and gopath settings shown above was substituted to resolve the Go installation path relative to the workspace.
In 0.15 and 0.16 these result in an error:
Failed to find the "go" binary in either GOROOT(${workspaceRoot}/0_build.noindex/_tools/go/current) or PATH(/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin. Check PATH, or Install Go and reload the window.
(I've tried using workspaceFolder here too and it still results in the same error)
Our project setup scripts bootstrap the Go installation under the workspace, so we include those values in the workspace .vscode/settings.json to simplify our devs' setup.
For now downgrading back to 0.14.4 is working until this is supported again.
I was able to verify that the interpolation still works in other variables like go.testEnvVars by setting an environment variable to ${workspaceRoot}, and then printing its value in a test.
Steps to reproduce the behavior:
- Set
go.goroot including ${workspaceRoot} or ${workspaceFolder}
- Reload
- See error
Failed to find the "go" binary ...
What version of Go, VS Code & VS Code Go extension are you using?
go versionto get version of Gocode -vorcode-insiders -vto get version of VS Code or VS Code Insidersgo envto get the go development environment detailsShare the Go related settings you have added/edited
Describe the bug
In versions 0.14.4 and earlier, the
${workspaceRoot}variable in thegorootandgopathsettings shown above was substituted to resolve the Go installation path relative to the workspace.In 0.15 and 0.16 these result in an error:
(I've tried using
workspaceFolderhere too and it still results in the same error)Our project setup scripts bootstrap the Go installation under the workspace, so we include those values in the workspace
.vscode/settings.jsonto simplify our devs' setup.For now downgrading back to 0.14.4 is working until this is supported again.
I was able to verify that the interpolation still works in other variables like
go.testEnvVarsby setting an environment variable to${workspaceRoot}, and then printing its value in a test.Steps to reproduce the behavior:
go.gorootincluding${workspaceRoot}or${workspaceFolder}Failed to find the "go" binary ...