diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-02-16 06:12:04 +0100 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-02-16 06:12:04 +0100 |
| commit | a50720227917ecd4770c667345f41fa88a4fda0b (patch) | |
| tree | c153fcf3526b75810a2683ac49daf4b1748bae2a | |
| parent | 6f612c117d33c383d2ac37d258c3d90f10717998 (diff) | |
| download | mp4-a50720227917ecd4770c667345f41fa88a4fda0b.tar.gz mp4-a50720227917ecd4770c667345f41fa88a4fda0b.zip | |
Add Err method to Writer
| -rw-r--r-- | writer.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -9,6 +9,7 @@ type writerFrame struct { type Writer struct { buf []byte pos int + err error // first deferred error stack [maxDepth]writerFrame depth int } @@ -26,6 +27,9 @@ func (w *Writer) Bytes() []byte { // Len returns the number of bytes written. func (w *Writer) Len() int { return w.pos } +// Err returns the first deferred error encountered during writing. +func (w *Writer) Err() error { return w.err } + // Write appends raw bytes. Implements io.Writer. func (w *Writer) Write(p []byte) (int, error) { copy(w.buf[w.pos:], p) |
