Skip to content

Commit

Permalink
log: changed if-else blocks to conform with golint (ethereum#16661)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Nov 15, 2024
1 parent 6459d0c commit 643f023
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions log/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,8 @@ func FailoverHandler(hs ...Handler) Handler {
err = h.Log(r)
if err == 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
Expand Down Expand Up @@ -320,13 +319,12 @@ func evaluateLazy(lz Lazy) (interface{}, error) {
results := value.Call([]reflect.Value{})
if len(results) == 1 {
return results[0].Interface(), nil
} else {
values := make([]interface{}, len(results))
for i, v := range results {
values[i] = v.Interface()
}
return values, nil
}
values := make([]interface{}, len(results))
for i, v := range results {
values[i] = v.Interface()
}
return values, nil
}

// DiscardHandler reports success for all writes but does nothing.
Expand Down

0 comments on commit 643f023

Please sign in to comment.