How to disable a SonarQube rule (ex. go:S3776) for the go language in the go code

In rare cases I want to disable one of the rule directly from the code. How is it possible for the go language?
Thanks
Walter

Hey there.

Are you trying to disable one specific instance, or disable it for the entire project?

I need to disable the rule in a specific line of code.

You should be able to use //NOSONAR (which will disable all rules for that line of code). It’s not possible to get more specific with in-code issue suppression for Go.

You can also exclude specific rules from specific files.

If you mark an issue as False-Positive/Won’t Fix in the SonarQube UI, this will also suppress the issue (including if you’re using SonarLint in Connected Mode).

Thanks for the answer. It seems strange that such powerful tool like SonarQube cannot allow to disable rules at code line level.
What about slang. I have found the following

How to disable rules through slang for go language?
Thanks
Walter