Skip to content

Commit

Permalink
log: changed if-else blocks to conform with golint (#16661)
Browse files Browse the repository at this point in the history
  • Loading branch information
GagziW authored and karalabe committed May 3, 2018
1 parent 577d375 commit ea1724d
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 ea1724d

Please sign in to comment.