Repository navigation
refactor: read the error detail through errors.Detail - #50
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
ERR-07 phase 2 (owner-approved 2026-11-21): require
github.com/jgolang/errors v0.7.0and read thedebugattribute through the new(*errors.Error).Detail()instead of the deprecatedWrapperfield. Leaves outotel/(does not import jgolang/errors directly; its tests pass). Not a stack; the next change is errors v0.8.0 (removesWrapperand 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 stacklessDefinesentinel still logsdebug: "", the branch the oldWrapper != nilguard covered.Verification
otel/:gofmt -l .empty,go vet ./...,go test -race ./...,govulncheck ./...all clean. Existing log/golden tests unchanged and passing.go test -bench=. -benchmem -count=6before/after (benchstat): B/op and allocs/op identical in every benchmark (e.g.ValidateArgs/coded_error1.336Ki, 24 allocs;LoggerInfo/coded_error_attr2.343Ki, 37 allocs); sec/op differences go both ways and are machine noise.Release notes (v1.7.3)
github.com/jgolang/errorsv0.7.0 and stops reading its deprecatedWrapperfield. Needed before upgrading to errors v0.8.0.🤖 Generated with Claude Code