Repository navigation
Releases: emar-kar/errbuf
Releases · emar-kar/errbuf
Release list
v1.3.1
Fixes & Improvements
Add — safer nested BufferedError flattening
Replaced the two-call nested.Err() + nested.Unwrap() pattern with a single
nested.Unwrap() snapshot. This removes a redundant lock round-trip and
eliminates the risk of holding two mutexes simultaneously when flattening
nested buffers.
Error — clarified pooled builder pre-sizing intent
Added a comment explaining why the Cap() == 0 guard is intentional: reused
builders from the pool retain their capacity, so the err.Error() scan is
skipped on subsequent calls and the builder grows naturally only if needed.
Format — corrected doc comment
Fixed a contradictory doc comment where %v was described as both single-line
and multiline.
v1.3.0
New Features
- Now natively supports
errors.Isanderrors.As, allowing you to query for specific target errors within the buffer. - Nested Flattening: BufferedError now intelligently unwraps and flattens nested BufferedError additions into a single robust slice, eliminating cyclic data-structure risks and boosting read performance.
Fixes & Stability
- Data Races Eliminated: Fixed complex concurrency data races across Add(), Grow(), and recursive multiline parsing. The buffer is now 100% thread-safe under parallel scaling.
- Memory Leaks Plugged: Bound
sync.Poolbuilder caching to a maximum of 32 KB per object, fixing silent memory leaks from formatting massive multi-megabyte string dumps.
Performance & Zero-Allocation Optimizations
- Zero-Allocation Clear(): The Clear() method now retains the underlying backing array capacity while zeroing out element references. This allows batch processing loops to function with exactly 0 allocs/op.
- Amortized Fast Appends: Heavy algorithmic passes over Add() and Error() reduce operations limits to the exact runtime boundaries. Parallel and single-append loops now execute securely without forcing native array duplication overheads.
v1.2.2
v1.2.1
v1.2.0
Package rework
Added
- Add
NewandNewFromErrorto replace oldNewErrorsBufferandNewBufferFromError - Add multiple errors handling into
Addmethod. - Add
Formatprocessing, adding support for %s, %v and %+v verbs. - Add
Clearmethod to empty internal buffer. - Add
Growmethod to grow internal buffer up to N items capacity.
Removed
- Remove warnings buffer.
Reworked
- Rework
Error()method output to be a single line by default. - Rework
Err()method, it will have to check errors on nil-ness since by adding multiple errors it's now possible to storenilvalues inside the internal buffer. - Rework
NewBufferFromWarningto panic on call, since warnings were removed as a concept.
Updated
- Update language version to v1.22