You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for reporting this. It looks like the problem is that gofmt started inserting this space in Go 1.19. For example, click 'Format' on this playground example: https://go.dev/play/p/rqHg9VRZkht
It is unfortunate that this gofmt change broke golangci-lint, but I don't think we can go against gofmt here. I'll chat with the team. If necessary, I'll file an issue with golangci-lint asking them to accomodate this change in gofmt. (gofmt is everywhere, so it's really not sustainable to have a tool that is incompatible with gofmt).
Per the discussion at golangci/golangci-lint#3201, they are aware of this issue and the solution is to use //nolint:all. I will follow up on golang/go#43776 to +1 that this should be better documented. In the meantime, I don't think there's anything we can do here, so closing.
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.go version go1.19.1 linux/amd64
gopls -v version
to get version of Gopls from the VS Code integrated terminal.golang.org/x/tools/gopls v0.9.5
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.1.71.2
v0.35.2
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.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"]
orgopls
prefixes.Describe the bug
When I write comment directive, a space is automatically added between slash and directive after save. This produces following lint message:
A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.
Steps to reproduce the behavior:
To reproduce, just write following code:
After saving, code is now:
The text was updated successfully, but these errors were encountered: