pkgerrors: quick refactoring for better readibility
This commit is contained in:
parent
6d2153805b
commit
9f1f25d2fa
|
@ -47,12 +47,11 @@ func MarshalStack(err error) interface{} {
|
|||
type stackTracer interface {
|
||||
StackTrace() errors.StackTrace
|
||||
}
|
||||
var st errors.StackTrace
|
||||
if err, ok := err.(stackTracer); ok {
|
||||
st = err.StackTrace()
|
||||
} else {
|
||||
sterr, ok := err.(stackTracer)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
st := sterr.StackTrace()
|
||||
s := &state{}
|
||||
out := make([]map[string]string, 0, len(st))
|
||||
for _, frame := range st {
|
||||
|
|
Loading…
Reference in New Issue