NOSONAR not working in VSCode with Go

Please provide

  • Operating system: Ventura 13.3.1
  • SonarLint plugin version: v3.18.0
  • Programming language you’re coding in: go
  • Is connected mode used: No

//NOSONAR and // NOSONAR are not suppressing sonarlint problems on a line in VSCode. I also tried every variation of // (at symbol)Suppress() and (at symbol)SuppressWarnings().

Without just turning off a rule in the plugin all together how can I suppress individual warnings in go?

Hello @kevink,

Thanks for your message. Could you, please provide us with a reproducer for the issue? In general NOSONAR should work. However, there could be multiple reasons why it doesn’t.

First of all, we need a proper reproducer and analysis logs to investigate it. Also, have you tested it in SonarQube or SonarCloud?

About suppressing issues. Have you tried it with an argument that indicates the rule code like SXXXX ? If yes and it still doesn’t work, could you, please, provide this reproducer too?

Regards,
Margarita

1 Like

hi, @Margarita_Nedzelska
I have the same issue in GoLand, like this:

SonarLint: 8.5.1.75093
GoLand: 2023.2.1
Go: 1.21.0

Hello @kevink,

I checked in IntelliJ and GoLand. Looks like we don’t have enabled “NOSONAR” feature in some languages in SonarLint. I’ve created a ticket to fix it:

https://sonarsource.atlassian.net/browse/SONARSLANG-613

Regards,
Margarita