title: go vet: catches inner but not outer race-condition
body: <p>In a <a href="https://stackoverflow.com/q/58533613/1218512">recent question</a> a nested loop was being used that led to a data-race. <code>go vet</code> only caught some of the problems.</p>
  
  <p>Using a simplified version:</p>
  
  <pre class="lang-golang prettyprint-override"><code>for _, o := range ol {
          o := o // &lt;- remove this: `go vet` does *NOT* complain
          for _, d := range dl {
              d := d // &lt;- remove this: `go vet` will complain
              go func() {
                  fmt.Printf("%03d %03d\n", o, d) // potential data-race
              }()
          }
      }
  </code></pre>
  
  <p><a href="https://play.golang.org/p/JhALssCu2-T" rel="nofollow noreferrer">Playground</a></p>
  
  <p><code>go vet</code> correctly detects the inner race-condition, but not the outer one.</p>
  
  <p>Why is this? Too complex to keep track of scopes deeper than 2 levels?</p>