Skip to content

v1.0.5

Choose a tag to compare

@n-ae n-ae released this 18 Jul 21:18

Patch release closing the L1 finding from
docs/assessment-maintainable-architect-v4-v1.0.4.md,
which reconciled two independent reviews of v1.0.4 (a Codex direct review
and a second third-party review) through fresh verification against actual
source. No breaking changes; module path unchanged.

Fixed:

  • isNilValue only recognized reflect.Pointer as a nil-capable kind, so
    while svcerr's own error types (all pointer-backed) were safe, a
    non-pointer custom Coder or StackTracer holding a nil concrete value
    • a named nil slice, map, func, chan, or interface - still reached its
      own method and panicked instead of degrading to INTERNAL_ERROR/no-stack
      the way a typed-nil pointer already did. Coder and StackTracer are
      documented open extension interfaces with no pointer-receiver
      requirement, so this was a real gap in the boundary the package
      otherwise guarantees. isNilValue now switches over every nil-capable
      reflect.Kind (Chan, Func, Interface, Map, Pointer, Slice)
      and returns IsNil() for each.
  • The isNilValue doc comment's claim that no error type in practice uses
    the non-pointer kinds is removed; it was disproved by the reviews'
    own reproduction.

Regression tests added for a nil-valued non-pointer Coder, the
StackTracer equivalent, and a non-nil-capable value Coder (a struct),
covering both the newly-guarded nil branch and the unaffected not-nil
default branch.

Test coverage: 100.0% (root module). zerologadapter is unchanged this
release - its go.mod already requires svcerr v1.0.4, and this is a
non-breaking patch, so no adapter bump is needed.