Open
Description
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
- Run
go version
to get version of Go from the VS Code integrated terminal.go version go1.24.1 linux/amd64
- Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.golang.org/x/tools/gopls v0.31.1-0.20250324134734-bf12eb7e7db4+dirty
- Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.1.99.0-insider dc289883be5d37d5d2b2f7d30926aa42a3123437
- Check your installed extensions to get the version of the VS Code Go extension
0.47.1
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.- gopls: /home/jabaile/go/bin/gopls (version: v0.31.1-0.20250324134734-bf12eb7e7db4+dirty built with go: go1.25-2d2bcdd2a)
gotests: not installed
gomodifytags: not installed
impl: not installed
goplay: not installed
dlv: /home/jabaile/go/bin/dlv (version: v1.24.1 built with go: go1.24.1)
golangci-lint: /home/jabaile/work/TypeScript-go/_tools/custom-gcl (version: v1.64.6+dirty built with go: go1.24.1)
- gopls: /home/jabaile/go/bin/gopls (version: v0.31.1-0.20250324134734-bf12eb7e7db4+dirty built with go: go1.25-2d2bcdd2a)
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.lintTool": "golangci-lint",
"go.alternateTools": {
"golangci-lint": "${workspaceFolder}/_tools/custom-gcl${env:GOEXE}"
},
Describe the bug
In order to support users of a repo that are using all OSs, I've had to use ${env:GOEXE}
to conditionally add .exe
on Windows via the Go extension's environment variable provider when configuring our golangci-lint custom
built binary.
It seems to me like this shouldn't be required; using a library like https://www.npmjs.com/package/which on the config would automatically net the correct path with extension for the tool.
Steps to reproduce the behavior:
- Configure
go.alternateTools
without an extension on Windows. - Run the tool (save to lint, or similar)
- Linter is not run.