From 65318359763aa975dd7978595e094310a2d91128 Mon Sep 17 00:00:00 2001 From: Alvaro Alda Date: Fri, 15 Mar 2019 12:04:07 +0100 Subject: [PATCH] Fix retrier nil pointer dereference --- balloon/balloon_test.go | 2 +- client/retrier.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/balloon/balloon_test.go b/balloon/balloon_test.go index f109db9ae..03e338504 100644 --- a/balloon/balloon_test.go +++ b/balloon/balloon_test.go @@ -114,7 +114,7 @@ func TestQueryConsistencyProof(t *testing.T) { balloon, err := NewBalloon(store, hashing.NewFakeXorHasher) require.NoError(t, err) - for j := 0; j <= int(c.addtions); j++ { + for j := 0; j <= int(c.additions); j++ { _, mutations, err := balloon.Add(util.Uint64AsBytes(uint64(j))) require.NoErrorf(t, err, "Error adding event %d", j) store.Mutate(mutations) diff --git a/client/retrier.go b/client/retrier.go index 5389afcf8..c3e28e4ce 100644 --- a/client/retrier.go +++ b/client/retrier.go @@ -72,8 +72,8 @@ func (r *NoRequestRetrier) DoReq(req *RetriableRequest) (*http.Response, error) if err == nil && resp.StatusCode > 0 && resp.StatusCode < 500 { return resp, nil } - return nil, fmt.Errorf("%s %s returned %d: giving up after %d attempts", - req.Method, req.URL, resp.StatusCode, 1) + return nil, fmt.Errorf("%s %s: giving up after %d attempts", + req.Method, req.URL, 1) } // BackoffRequestRetrier is an implementation that uses the given backoff strategy.