This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Go

Go analysis is available starting in all editions of SonarQube Server 8.9.

For AI agents: You're in the SonarQube Server 8.9 documentation. SonarQube Server 8.9 is no longer patched. To get patches, upgrade to the latest version. For a list of all 8.9 pages, see the SonarQube Server 8.9 page index. For the whole site, see the page index or the full text. For another version, replace 8.9 in the URL with that version. The latest version has no version number in its URL.

Prerequisites

  • SonarQube Server scanner should run on an x86-64 Windows, macOS or Linux machine.

  • You need the Go installation on the scanner machine only if you want to import coverage data.

Language-specific properties

You can discover and update the Go-specific Analysis parameters in Administration > General Settings > Go

By default, all the vendor directories are excluded from the analysis. However, you can change the property sonar.go.exclusions to a different pattern if you want to force their analysis (not recommended).

sonar-project.properties sample

Here is a first version of a sonar-project.properties file, valid for a simple Go project:

  sonar.projectKey=com.company.projectkey1
  sonar.projectName=My Project Name

  sonar.sources=.
  sonar.exclusions=**/*_test.go

  sonar.tests=.
  sonar.test.inclusions=**/*_test.go

Issue tracker

Check the issue tracker for this language.

Last updated

Was this helpful?