code: func (bufPool *BufioWriterPool) NewWriteCloserWrapper(buf *bufio.Writer, w io.Writer) io.WriteCloser {
  	return ioutils.NewWriteCloserWrapper(w, func() error {
  		buf.Flush()
  		if writeCloser, ok := w.(io.WriteCloser); ok {
  			writeCloser.Close()
  		}
  		bufPool.Put(buf)
  		return nil
  	})
  }
docs: // NewWriteCloserWrapper returns a wrapper which puts the bufio.Writer back
  // into the pool and closes the writer if it's an io.Writecloser.