title: Does Go automatically close resources if not explicitly closed?
body: <p>The following <code>Open</code> followed by a deferred <code>Close</code> is idiomatic in Go:</p>
  
  <pre class="lang-golang prettyprint-override"><code>func example() {
      f, err := os.Open(path)
      if err != nil {
          return
      }
      defer f.Close()
  }
  </code></pre>
  
  <p>What happens if I don't have <code>defer f.Close()</code>? </p>
  
  <p>When I call this function and <code>f</code> goes out of scope, does it automatically close the file or do I have a zombie file handle? </p>
  
  <p>If it closes automatically, when exactly does it do this?</p>