vscode-go
vscode-go copied to clipboard
Go 1.24 Tool Directive: Add support for tool dependencies from `go get tool`
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
- Run
go versionto get version of Go from the VS Code integrated terminal.- 1.24.1
- Run
gopls -v versionto get version of Gopls from the VS Code integrated terminal.- 0.19.1
- Run
code -vorcode-insiders -vto get version of VS Code or VS Code Insiders.- 1.97.0
- Check your installed extensions to get the version of the VS Code Go extension
- 0.48.0
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Toolscommand. -
Share the Go related settings you have added/edited
"go.alternateTools": {
"customFormatter": "golangci-lint"
},
"go.formatFlags": ["fmt", "--stdin"],
"go.formatTool": "custom",
"go.inlayHints.assignVariableTypes": true,
"go.inlayHints.compositeLiteralFields": true,
"go.inlayHints.constantValues": true,
"go.inlayHints.rangeVariableTypes": true,
"go.lintFlags": ["--path-mode=abs"],
"go.lintTool": "golangci-lint",
"go.testFlags": ["-v"],
"go.useLanguageServer": true,
Describe the bug
The extension is not detecting golangci-lint when it's installed with the new command go get -tool.
It will use the embedded v1 version.
Steps to reproduce the behavior:
- Run
go get -tool github.com/golangci/golangci-lint/v2/cmd/[email protected] - Start vscode
- try to lint go code, it will use the embedded v1 version and throw an error about
unknown flag: --path-mode
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.