aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/writer.go b/writer.go
index e4dd8cb..2e431ee 100644
--- a/writer.go
+++ b/writer.go
@@ -81,10 +81,11 @@ func (w *Writer) putFixedString(s string, length int) {
w.pos += length
}
-// Reset resets the writer position to 0.
+// Reset resets the writer position to 0 and clears any error state.
func (w *Writer) Reset() {
w.pos = 0
w.depth = 0
+ w.err = nil
}
// StartBox begins a new box. Write content, then call EndBox.