title: Set environment variable for Go tests
body: <p>I am trying to run my Go tests like this, setting an environment variable:</p>
  
  <pre><code>FOO=BAR go list ./... | grep -v vendor | xargs -n1 go test -timeout=3s
  </code></pre>
  
  <p>Inside my tests I do:</p>
  
  <pre><code>log.Print(os.Getenv("FOO"))
  </code></pre>
  
  <p>Which returns an empty string. Why is FOO not set?</p>