title: ReadAll from File not working as Expected
body: <p>I am trying to create a temporary gzip file and write to the file. The problem is that I am not understanding what is going on with ReadAll. I expected ReadAll to return the bytes written to the file... however there are none. Yet the File.Stat command shows that there is indeed data.</p>
  
  <pre><code>filename := "test"
  file, err := ioutil.TempFile("", filename)
  if err != nil {
      fmt.Println(err)
  }
  defer func() {
      if err := os.Remove(file.Name()); err != nil {
          fmt.Println(err)
      }
  }()
  
  w := gzip.NewWriter(file)
  _, err = w.Write([]byte("hell0"))
  if err != nil {
      fmt.Println(err)
  }
  
  fileInfo, err := file.Stat()
  if err != nil {
      fmt.Println(err)
  }
  fileBytes, err := ioutil.ReadAll(file)
  if err != nil {
      fmt.Println(err)
  }
  if err := w.Close(); err != nil {
      fmt.Println(err)
  }
  fmt.Println("SIZE1:", fileInfo.Size())
  fmt.Println("SIZE2:", len(fileBytes))
  </code></pre>
  
  <p>Here is a playground link   <a href="https://play.golang.org/p/zX8TSCAbRL" rel="nofollow noreferrer">https://play.golang.org/p/zX8TSCAbRL</a></p>
  
  <p>Why are there no returned bytes?
  How do I get the returned bytes?</p>