title: How to test io.writer in golang?
body: <p>Recently I hope to write a unit test for golang. The function is as below.</p>
  
  <pre><code>func (s *containerStats) Display(w io.Writer) error {
      fmt.Fprintf(w, "%s %s\n", "hello", "world")
      return nil
  }
  </code></pre>
  
  <p>So how can I test the result of "func Display" is "hello world"?</p>