Write makes one call on the underlying writer if no error has previously occurred.
(buf []byte)
| 26 | // Write makes one call on the underlying writer |
| 27 | // if no error has previously occurred. |
| 28 | func (w *Writer) Write(buf []byte) (n int, err error) { |
| 29 | if w.err != nil { |
| 30 | return 0, w.err |
| 31 | } |
| 32 | n, w.err = w.w.Write(buf) |
| 33 | w.n += int64(n) |
| 34 | return n, w.err |
| 35 | } |
| 36 | |
| 37 | // Err returns the first error encountered by Write, if any. |
| 38 | func (w *Writer) Err() error { |
no outgoing calls