code: func ToWriteCloser(w io.Writer) io.WriteCloser {
  	if rw, ok := w.(io.WriteCloser); ok {
  		return rw
  	}
  
  	return struct {
  		io.Writer
  		io.Closer
  	}{
  		w,
  		ioutil.NopCloser(nil),
  	}
  }
docs: // ToWriteCloser creates an io.WriteCloser from the given io.Writer.
  // If it's not already, one will be created with a Close method that does nothing.