Repository navigation
feat: add Detail accessor and deprecate Wrapper - #21
Merged
Merged
Conversation
Detail returns the text of the wrapped cause, which log reads for its debug attribute. The exported Wrapper field ties the public API to github.com/go-errors/errors; it is deprecated in favor of Detail, StackTrace and StackTraceStr and will be removed in v0.8.0 (ERR-07). 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 1 of 3 (owner-approved 2026-11-21): add
(*Error).Detail()and deprecate the exportedWrapperfield. Leaves out removingWrapperand droppinggithub.com/go-errors/errors, which ship in v0.8.0 afterjgolang/logstops readingWrapper. Not a stack; follow-ups: log v1.7.3 (switch toDetail), errors v0.8.0 (removeWrapperand go-errors).Reason
Wrapper *goerrors.Errorties this leaf module's public API to a third-party package, so go-errors cannot be dropped without a breaking change.logreadscoded.Wrapper.Error()for itsdebugattribute; it needs a stable accessor first (constitution V: the replacement ships in the same release as the deprecation).Changes
errors.go:func (err *Error) Detail() stringreturns the wrapped error's text (Wrapper.Error()),""for a nil receiver or an error without a stack trace (aDefinesentinel).Wrappercarries aDeprecated:paragraph.StackTraceStrandErrorread throughDetail; output unchanged.New,NewC,Wrap,With,WithC,WrapC,Define; nil receiver;ExampleError_Detail.README.md: Stack Traces section documentsDetailand the deprecation.Verification
gofmt -l .empty,go vet ./...ok,go test -race ./...ok,govulncheck ./...no vulnerabilities.go doc . ErrorshowsDetailand theDeprecated:paragraph onWrapper.Release notes (v0.7.0)
(*Error).Detail()returns the text of the wrapped cause.Error.Wrapperfield. UseDetailfor the cause's text andStackTrace/StackTraceStrfor the stack.Wrapperwill be removed in v0.8.0 together with thegithub.com/go-errors/errorsdependency.🤖 Generated with Claude Code