Commit 0bc7b22
committed
fix: prevent data loss in BracketWriter on write errors
Move buffer advancement after the successful write to the underlying
writer. Previously, the line was removed from the buffer before the
write, so a failed write (e.g., full disk) would lose the log entry.
Also avoids an unnecessary string allocation by passing the byte
slice directly to fmt.Fprintf.1 parent a1da825 commit 0bc7b22
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
0 commit comments