Skip to content

Releases: emar-kar/errbuf

v1.3.1

Choose a tag to compare

@emar-kar emar-kar released this 13 Mar 17:07
6b77d4f

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

Choose a tag to compare

@emar-kar emar-kar released this 13 Mar 14:58
f9a878c

New Features

  • Now natively supports errors.Is and errors.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.Pool builder 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

Choose a tag to compare

@emar-kar emar-kar released this 14 Jan 18:32
697535e

Remove ability to create new Buffer from nil error

v1.2.1

Choose a tag to compare

@emar-kar emar-kar released this 14 Jan 17:53
4b5d0aa

Remove holding nil inside the buffer.
Remove multiple errors Add

v1.2.0

Choose a tag to compare

@emar-kar emar-kar released this 13 Jan 13:57
23a18a9

Package rework

Added

  • Add New and NewFromError to replace old NewErrorsBuffer and NewBufferFromError
  • Add multiple errors handling into Add method.
  • Add Format processing, adding support for %s, %v and %+v verbs.
  • Add Clear method to empty internal buffer.
  • Add Grow method 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 store nil values inside the internal buffer.
  • Rework NewBufferFromWarning to panic on call, since warnings were removed as a concept.

Updated

  • Update language version to v1.22

v1.1.0

Choose a tag to compare

@emar-kar emar-kar released this 17 Sep 10:38
8bba072

Change Add and Warn to be no-op if error is nil

v1.0.0

Choose a tag to compare

@emar-kar emar-kar released this 04 Jul 16:49
initial commit