title: How expensive it is to read an environment variable?
body: <p>It's pretty common to read an environment variable and store it in a regular variable to reuse it along the way. Something like</p>
  <pre class="lang-golang prettyprint-override"><code>myVal := os.GetEnv(&quot;FOO&quot;)
  if myVal == &quot;bar&quot; {
    ...
  }
  </code></pre>
  <p>But that got me wondering. Apart from readability, does that give any kind of performance boost to use a declared variable rather than using a <code>getEnv</code> method every time ?</p>
  <p>To put it differently, is it more expensive to access anvironment variable than a declared variable, or is it exactly the same ?</p>