Skip to content

Commit

Permalink
fix: use unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
teru01 committed May 12, 2024
1 parent 1b43fe7 commit 7664a47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ func (x *Error) Format(s fmt.State, verb rune) {
if s.Flag('+') {
_, _ = io.WriteString(s, x.Error())
var c *Error
for c = x; c.cause != nil; c = c.cause.(*Error) {
for c = x; c.Unwrap() != nil; {
cause, ok := c.Unwrap().(*Error)
if !ok {
break
}
c = cause
}
c.st.Format(s, verb)
return
Expand Down

0 comments on commit 7664a47

Please sign in to comment.