title: How do I check for an empty slice?
body: <p>I am calling a function that returns an empty array if there are no values.</p>
  
  <p>When I do this it doesn't work:</p>
  
  <pre><code>if r == [] {
      fmt.Println("No return value")            
  }
  </code></pre>
  
  <p>The work around I'm using is:</p>
  
  <pre><code>var a [0]int
  if r == a {
      fmt.Println("No return value")            
  }
  </code></pre>
  
  <p>But declaring a variable just to check the return value doesn't seem right. What's the better way to do this?</p>