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 {
|
type stackTracer interface {
|
||||||
StackTrace() errors.StackTrace
|
StackTrace() errors.StackTrace
|
||||||
}
|
}
|
||||||
var st errors.StackTrace
|
sterr, ok := err.(stackTracer)
|
||||||
if err, ok := err.(stackTracer); ok {
|
if !ok {
|
||||||
st = err.StackTrace()
|
|
||||||
} else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
st := sterr.StackTrace()
|
||||||
s := &state{}
|
s := &state{}
|
||||||
out := make([]map[string]string, 0, len(st))
|
out := make([]map[string]string, 0, len(st))
|
||||||
for _, frame := range st {
|
for _, frame := range st {
|
||||||
|
|
Loading…
Reference in New Issue