# Go

## Supported versions <a href="#suoported-versions" id="suoported-versions"></a>

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.

Go versions 1.0 to 1.25 are supported.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* 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](https://golang.org/) installation on the scanner machine only if you want to import coverage data.

## Language-specific properties <a href="#language-specific-properties" id="language-specific-properties"></a>

You can discover and update the Go-specific [analysis-parameters](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/analysis-parameters "mention") by going to **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 <a href="#sonar-project-properties" id="sonar-project-properties"></a>

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

```css-79elbk
sonar.projectKey=com.company.projectkey1
sonar.projectName=My Project Name

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

## Related pages <a href="#related-pages" id="related-pages"></a>

* [overview](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/test-coverage/overview "mention")
* [external-analyzer-reports](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/importing-external-issues/external-analyzer-reports "mention") (GoVet, GoLint, GoMetaLinter)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/languages/go.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
