Start Free
SonarQube Community Build | Analyzing source code | Languages | Go

Go

On this page

Supported versions

The level of support for a language is defined as follows: 

  • Fully supported: Analysis will complete. All the language features are understood and examined.
  • Supported: Most language features are understood and examined but the version includes unsupported features. Analysis might break or provide incomplete results.

Versions 1.0 to 1.23 are supported.

Prerequisites

  • Your SonarScanner should be run on one of the following machines:
    • x86-64 Windows
    • macOS (amd64 and arm64 are supported)
    • Linux (amd64 and arm64 are supported)
  • 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 properties in Administration > Configuration > General Settings > Languages > 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).

If you modify the sonar.go.exclusions or the sonar.sources property, be sure that go.mod files are included in your scan. If the go.mod files are excluded, the analysis results are less precise. 

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

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved.

Creative Commons License