https://github.com/sonarsource/sonar-go
Go Analyzer
https://github.com/sonarsource/sonar-go
Last synced: about 1 year ago
JSON representation
Go Analyzer
- Host: GitHub
- URL: https://github.com/sonarsource/sonar-go
- Owner: SonarSource
- License: other
- Created: 2024-07-10T07:52:46.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-07-01T15:44:35.000Z (about 1 year ago)
- Last Synced: 2025-07-01T16:49:04.447Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 5.72 MB
- Stars: 6
- Watchers: 15
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Sonar-Go
[](https://cirrus-ci.com/github/SonarSource/sonar-go)
[](https://sonarcloud.io/summary/new_code?id=SonarSource_sonar-go)
[](https://sonarcloud.io/summary/new_code?id=SonarSource_sonar-go)
This is a developer documentation. If you want to analyze source code in SonarQube read the [analysis of Go documentation](https://docs.sonarqube.org/latest/analysis/languages/go/).
We use the native Go parser to parse the Go language.
## Have questions or feedback?
To provide feedback (request a feature, report a bug, etc.) use the [SonarQube Community Forum](https://community.sonarsource.com/). Please do not forget to specify the language, plugin version, and SonarQube version.
## Building
### Setup
To configure build dependencies, run the following command:
```shell
git submodule update --init -- build-logic
```
To always get the latest version of the build logic during git operations, set the following configuration:
```shell
git config submodule.recurse true
```
For more information see [README.md](https://github.com/SonarSource/cloud-native-gradle-modules/blob/master/README.md) of cloud-native-gradle-modules.
Additionally, if you are on Windows, read the [sonar-go-to-slang/README.md](sonar-go-to-slang/README.md) instructions.
### Build
Build and run Unit Tests:
```shell
./gradlew build
```
### Dependency verification
Dependency verification by Gradle is enabled for this project. If unknown dependencies appear during the build, you will get an error
with a message like `Dependency verification failed for configuration ...`.
In this case, you can update the file `gradle/verification-metadata.xml` with the command:
```shell
./gradlew --write-verification-metadata sha256
```
and manually verify correctness of the added data.
In most cases, the `help` task will resolve most of the dependencies without executing anything:
```shell
./gradlew --write-verification-metadata sha256 help
```
The file is regenerated on CI automatically, once it grows over specified number of lines.
## License headers
License headers are automatically updated by the spotless plugin.
## License
Copyright 2012-2025 SonarSource.
SonarQube analyzers released after November 29, 2024, including patch fixes for prior versions,
are published under the [Sonar Source-Available License Version 1 (SSALv1)](LICENSE.txt).
See individual files for details that specify the license applicable to each file.
Files subject to the SSALv1 will be noted in their headers.