Skip to content

refactor: read the error detail through errors.Detail - #50

Merged
josuegiron merged 1 commit into
masterfrom
fix/use-errors-detail
Nov 21, 2026
Merged

josuegiron merged 1 commit into
masterfrom
fix/use-errors-detail

Conversation

@josuegiron

Copy link
Copy Markdown
Member

Scope

ERR-07 phase 2 (owner-approved 2026-11-21): require github.com/jgolang/errors v0.7.0 and read the debug attribute through the new (*errors.Error).Detail() instead of the deprecated Wrapper field. Leaves out otel/ (does not import jgolang/errors directly; its tests pass). Not a stack; the next change is errors v0.8.0 (removes Wrapper and go-errors), then a log PR raising errors to v0.8.0.

Reason

errors v0.8.0 removes Wrapper. A log release that still reads it would fail to compile against errors v0.8.0 once MVS selects it, so log must switch first and release.

Changes

  • go.mod/go.sum: errors v0.6.2 → v0.7.0.
  • internal/codederror/codederror.go: debug := coded.Detail() (same text; "" when there is no wrapper).
  • error_test.go: characterization test that a stackless Define sentinel still logs debug: "", the branch the old Wrapper != nil guard covered.

Verification

  • Root and otel/: gofmt -l . empty, go vet ./..., go test -race ./..., govulncheck ./... all clean. Existing log/golden tests unchanged and passing.
  • go test -bench=. -benchmem -count=6 before/after (benchstat): B/op and allocs/op identical in every benchmark (e.g. ValidateArgs/coded_error 1.336Ki, 24 allocs; LoggerInfo/coded_error_attr 2.343Ki, 37 allocs); sec/op differences go both ways and are machine noise.

Release notes (v1.7.3)

  • Requires github.com/jgolang/errors v0.7.0 and stops reading its deprecated Wrapper field. Needed before upgrading to errors v0.8.0.
  • No API or output change.

🤖 Generated with Claude Code

errors v0.7.0 deprecates the exported Wrapper field and adds Detail,
which returns the same text. Reading it through the accessor lets
errors v0.8.0 remove Wrapper and its go-errors dependency (ERR-07).
The logged debug attribute is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@josuegiron
josuegiron merged commit 77fca5d into master Nov 21, 2026
2 checks passed
@josuegiron
josuegiron deleted the fix/use-errors-detail branch November 21, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant