Skip to content

Choose Go Environment -> Choose from file browser does not work on Windows #868

@ChrisHines

Description

@ChrisHines

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 windows/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.50.1
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.18.0
  • Run go env to get the go development environment details
    • set GO111MODULE=
      set GOARCH=amd64
      set GOBIN=
      set GOCACHE=C:\Users\Chris\AppData\Local\go-build
      set GOENV=C:\Users\Chris\AppData\Roaming\go\env
      set GOEXE=.exe
      set GOFLAGS=
      set GOHOSTARCH=amd64
      set GOHOSTOS=windows
      set GOINSECURE=
      set GOMODCACHE=C:\Users\Chris\Go\pkg\mod
      set GONOPROXY=
      set GONOSUMDB=
      set GOOS=windows
      set GOPATH=C:\Users\Chris\Go
      set GOPRIVATE=
      set GOPROXY=https://proxy.golang.org,direct
      set GOROOT=c:\go
      set GOSUMDB=sum.golang.org
      set GOTMPDIR=
      set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
      set GCCGO=gccgo
      set AR=ar
      set CC=gcc
      set CXX=g++
      set CGO_ENABLED=1
      set GOMOD=
      set CGO_CFLAGS=-g -O2
      set CGO_CPPFLAGS=
      set CGO_CXXFLAGS=-g -O2
      set CGO_FFLAGS=-g -O2
      set CGO_LDFLAGS=-g -O2
      set PKG_CONFIG=pkg-config
      set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Chris\AppData\Local\Temp\go-build548893822=/tmp/go-build -gno-record-gcc-switches

Share the Go related settings you have added/edited

"go.useLanguageServer": true,
"[go]": {
	"files.eol": "\n", // formatting only supports LF line endings
	"editor.snippetSuggestions": "none",
	"editor.formatOnSave": true,
	"editor.codeActionsOnSave": {
		"source.organizeImports": true
	}
},
"gopls": {
	"usePlaceholders": true, // add parameter placeholders when completing a function
	"hoverKind": "FullDocumentation", // for documentation in completion items
	// Experimental settings
	"staticcheck": true,
},
"go.testFlags": [
	// "-v",
	"-race",
],
"go.coverOnSingleTest": true,
"go.vetOnSave": "off",
"go.buildOnSave": "off",
"go.installDependenciesWhenBuilding": false,
"go.gotoSymbol.includeGoroot": true,
"go.gotoSymbol.includeImports": true,
"go.coverOnSingleTestFile": true,
"go.formatTool": "goimports",
"go.testTimeout": "2m",
"go.coverMode": "atomic",

Describe the bug

On Windows, manually choosing a go.exe command via the Go Status Bar does not work.

Steps to reproduce the behavior:

Navigate in the UI as follows:

  1. Click the Go Status Bar
  2. Choose Go Environment
  3. Choose from file browser
  4. Pick any valid go.exe binary

See an error window appear reporting, "/C:/Go/bin/go.exe is not an executable"

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions