(p []byte)
| 426 | } |
| 427 | |
| 428 | func (cw *countingWriter) Write(p []byte) (int, error) { |
| 429 | n, err := cw.w.Write(p) |
| 430 | cw.n.Add(int64(n)) |
| 431 | if err != nil { |
| 432 | return n, fmt.Errorf("counting writer: %w", err) |
| 433 | } |
| 434 | return n, nil |
| 435 | } |
| 436 | |
| 437 | func (cw *countingWriter) Count() int64 { return cw.n.Load() } |
| 438 |
no outgoing calls