forked from cerc-io/plugeth
log: changed if-else blocks to conform with golint (#16661)
This commit is contained in:
parent
577d375a0d
commit
ea1724de1a
@ -234,9 +234,8 @@ func FailoverHandler(hs ...Handler) Handler {
|
|||||||
err = h.Log(r)
|
err = h.Log(r)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
} else {
|
|
||||||
r.Ctx = append(r.Ctx, fmt.Sprintf("failover_err_%d", i), err)
|
|
||||||
}
|
}
|
||||||
|
r.Ctx = append(r.Ctx, fmt.Sprintf("failover_err_%d", i), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
@ -320,14 +319,13 @@ func evaluateLazy(lz Lazy) (interface{}, error) {
|
|||||||
results := value.Call([]reflect.Value{})
|
results := value.Call([]reflect.Value{})
|
||||||
if len(results) == 1 {
|
if len(results) == 1 {
|
||||||
return results[0].Interface(), nil
|
return results[0].Interface(), nil
|
||||||
} else {
|
}
|
||||||
values := make([]interface{}, len(results))
|
values := make([]interface{}, len(results))
|
||||||
for i, v := range results {
|
for i, v := range results {
|
||||||
values[i] = v.Interface()
|
values[i] = v.Interface()
|
||||||
}
|
}
|
||||||
return values, nil
|
return values, nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// DiscardHandler reports success for all writes but does nothing.
|
// DiscardHandler reports success for all writes but does nothing.
|
||||||
// It is useful for dynamically disabling logging at runtime via
|
// It is useful for dynamically disabling logging at runtime via
|
||||||
|
Loading…
Reference in New Issue
Block a user