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.18.1
- Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.- 1.98.2
- Check your installed extensions to get the version of the VS Code Go extension
- 0.46.1
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.
# Tools Configuration
## Environment
GOBIN: undefined
toolsGopath:
gopath: /home/logica/go
GOROOT: /usr/local/go
PATH: /home/logica/.vscode-server/bin/ddc367ed5c8936efe395cffeec279b04ffd7db78/bin/remote-cli:/home/linuxbrew/.linuxbrew/opt/clang-format/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Common Files/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/mnt/c/WINDOWS/System32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/MATLAB/R2022a/bin:/mnt/c/Program Files (x86)/dotnet/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files (x86)/Tailscale IPN/:/mnt/c/Program Files/Tailscale/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/Takuto/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/Java/jdk-11.0.12/bin:/mnt/c/Users/Takuto/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin:/usr/local/go/bin:/home/logica/go/bin:/home/logica/.bun/bin:/home/logica/.krew/bin
## Tools
go: /usr/local/go/bin/go: go version go1.24.1 linux/amd64
gopls: /home/logica/go/bin/gopls (version: v0.18.1 built with go: go1.24.1)
gotests: /home/logica/go/bin/gotests (version: v1.6.0 built with go: go1.24.1)
gomodifytags: /home/logica/go/bin/gomodifytags (version: v1.17.0 built with go: go1.24.1)
impl: /home/logica/go/bin/impl (version: v1.4.0 built with go: go1.24.1)
goplay: /home/logica/go/bin/goplay (version: v1.0.0 built with go: go1.24.1)
dlv: /home/logica/go/bin/dlv (version: v1.24.1 built with go: go1.24.1)
golangci-lint: /home/logica/go/bin/golangci-lint (version: v2.0.0 built with go: go1.24.1)
golangci-lint: /home/logica/go/bin/golangci-lint (version: v2.0.0 built with go: go1.24.1)
## Go env
Workspace Folder (vault-provisioner): /home/logica/prj/personal/vault-provisioner
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/logica/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/logica/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2113586740=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/logica/prj/personal/vault-provisioner/go.mod'
GOMODCACHE='/home/logica/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/logica/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/logica/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.1'
GOWORK=''
PKG_CONFIG='pkg-config'
Share the Go related settings you have added/edited
{
"go.toolsManagement.autoUpdate": true,
"go.lintOnSave": "workspace",
"go.lintTool": "golangci-lint",
}
Describe the bug
After updating golangci-lint to v2, lining using golanci-lint always fails with the logs below.
2025-03-25 02:19:36.239 [info] Running checks...
2025-03-25 02:19:36.239 [info] Starting linting the current workspace at /home/logica/prj/personal/vault-provisioner
2025-03-25 02:19:36.407 [error] Error while running tool: /home/logica/go/bin/golangci-lint run --print-issued-lines=false --out-format=colored-line-number --issues-exit-code=0 ./...
2025-03-25 02:19:36.407 [error] Error: unknown flag: --print-issued-lines
Failed executing command with error: unknown flag: --print-issued-lines
This error occurs because --print-issued-lines
and --out-format
flags were deleted in v2.
These flags seem to have the same output in v2.
/home/logica/go/bin/golangci-lint run --output.text.print-issued-lines=false --output.text.path=stdout --output.text.colors=true --show-stats=false --issues-exit-code=0 ./...
Thus, we need to switch flags depending on the version of golangci-lint.
Steps to reproduce the behavior:
- Install golangci-lint v2
- Set "go.lintTool" to "golangci-lint"
- Run "Go: Lint Workspace" command
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.