title: How to run SonarQube for Go code using Jenkins
body: <p>I need to run SonarQube for Go code using Jenkins. Unfortunately, there is little information regarding this task.</p>
  <p>I have found that the &quot;sonar-project.properties&quot; file should be created, for example:</p>
  <pre><code>  sonar.projectKey=com.company.projectkey1
    sonar.projectName=My Project Name
  
    sonar.sources=.
    sonar.exclusions=**/*_test.go,**/vendor/**
  
    sonar.tests=.
    sonar.test.inclusions=**/*_test.go
    sonar.test.exclusions=**/vendor/**
  </code></pre>
  <p>But how to configure a Jenkins pipeline correctly? I found the following example, but I'm not sure if this is what I need</p>
  <pre><code>node {
    stage('SCM') {
      git '&lt;my_path&gt;.git'
    }
    stage('SonarQube analysis') {
      def scannerHome = tool 'SonarScanner 4.0';
      withSonarQubeEnv('My SonarQube Server') { 
        sh &quot;${scannerHome}/bin/sonar-scanner&quot;
      }
    }
  }
  
  </code></pre>