Releases: go-coldbrew/errors
Releases · go-coldbrew/errors
v0.2.15
What's New
- Drop-in replacement for stdlib
errors: Re-exportIs,As,Unwrap,Join, andErrUnsupportedfrom the standard library AsTypegeneric re-export: Available behind//go:build go1.26build tag- Standalone
Cause(err) errorfunction: Walks theUnwrapchain to find the root cause — works on any error, not justErrorExt - Bounded traversal:
Causeuses a max depth guard to protect against cyclicUnwrapchains - Updated package documentation and examples
v0.2.14
v0.2.13
v0.2.12
v0.2.11
v0.2.10
v0.2.9
v0.2.8
What's Changed
- fix: race-safe asyncSem — replaced bare channel variable with
atomic.Pointer[chan struct{}]+sync.Onceguard - fix: atomic shouldNotify — converted
customError.shouldNotifyfrombooltoatomic.Boolto fix data race in concurrentNotifyAsync - fix: safe type assertion in GetTraceId — comma-ok idiom prevents panic on non-string tracerID value
- Default async notification concurrency reduced from 1000 to 20
- Makefile bench regex fix (
^$→^$$)
v0.2.7
What's Changed
Lazy stack trace capture (6.5x faster error creation)
Replaces eager per-frame stack capture with batch PC capture and deferred symbolization.
Benchmark results (Apple M1 Pro):
| Benchmark | Before | After | Improvement |
|---|---|---|---|
errors.New |
3500 ns / 1600 B / 19 allocs | 540 ns / 392 B / 6 allocs | 6.5x faster, 75% less memory |
New + StackFrame() |
3500 ns / 1600 B / 19 allocs | 1250 ns / 824 B / 9 allocs | 2.8x faster, 49% less memory |
NewDeepStack (32 frames) |
40500 ns / 17 KB / 125 allocs | 1060 ns / 392 B / 6 allocs | 38x faster, 98% less memory |
Changes
- Batch PC capture: single
runtime.Callers()replaces loop ofruntime.Caller(i)+runtime.FuncForPC(pc) - Lazy symbolization:
StackFrame()resolves frames on first access viasync.Once+runtime.CallersFrames - Default depth: reduced from 64 to 16 frames (configurable via
SetMaxStackDepth, accepts [1, 256]) - Thread-safe config:
SetMaxStackDepthusesatomic.Int32,SetBaseFilePathusesatomic.Value - Frame capping:
resolveFramescaps output at captured PC count to handle inlining expansion - basePath snapshot: captured at error creation time, not resolution time — eliminates races
- Pointer receivers: all
customErrormethods (required bysync.Once)
Compatibility
Callers() []uintptr— unchangedStackFrame() []StackFrame— same output, now lazy- Sentry, Rollbar, Airbrake notifiers — all work unchanged
v0.2.6
Changes
- Migrate notifier from OpenTracing to OTEL trace context
- Application correlation ID (
GetTraceId) takes precedence over OTEL span trace ID - Error notifications now include both
traceId(correlation) andotelTraceId(distributed trace) - Remove
opentracing-godependency - Bump
go-coldbrew/tracingto v0.2.0