WriteTo writes to w. The value in w is wrapped when passed to fn keeping track of how bytes are written by fn.
(w io.Writer)
| 60 | // |
| 61 | // The value in w is wrapped when passed to fn keeping track of how bytes are written by fn. |
| 62 | func (fn WriterToFunc) WriteTo(w io.Writer) (n int64, err error) { |
| 63 | wc := writeCounter{Writer: w} |
| 64 | err = fn(&wc) |
| 65 | return wc.Count(), err |
| 66 | } |