title: Short circuit evaluation in Go
body: <p>My understanding of short circuit evaluation is that an expression is only called when needed in an if statement. Does Go follow this?</p>
  
  <p>For instance, would I get better performance on average from:</p>
  
  <pre><code>if !isValidQueryParams(&amp;queries) || r == nil || len(queries) == 0 {
      return "", fmt.Errorf("invalid querystring")
  }
  </code></pre>
  
  <p>...to this:</p>
  
  <pre><code>if r == nil || len(queries) == 0 || !isValidQueryParams(&amp;queries) {
      return "", fmt.Errorf("invalid querystring")
  }
  </code></pre>
  
  <p>...since <code>isValidQueryParams</code> is a function with much more overhead than <code>r == nil</code> or testing the length of a map?</p>
  
  <p>i.e. will the interpreter evaluate r == nil first, see it's true and not bother to evaluate the other conditions?</p>
  
  <p>EDIT: Incorrectly referred to short circuit evaluation as lazy evaluation</p>