1
0
Fork 0

refactor: some minor changes.

This commit is contained in:
Fernandez Ludovic 2018-02-19 01:04:45 +01:00 committed by Traefiker Bot
parent 529e34d2ae
commit b9d8eff994
9 changed files with 24 additions and 76 deletions

View file

@ -19,7 +19,7 @@ func TestMetricsRetryListener(t *testing.T) {
wantCounterValue := float64(2)
if retryMetrics.retriesCounter.CounterValue != wantCounterValue {
t.Errorf("got counter value of %d, want %d", retryMetrics.retriesCounter.CounterValue, wantCounterValue)
t.Errorf("got counter value of %f, want %f", retryMetrics.retriesCounter.CounterValue, wantCounterValue)
}
wantLabelValues := []string{"backend", "backendName"}

View file

@ -174,7 +174,7 @@ func TestNewRegexHandler(t *testing.T) {
assert.Equal(t, test.expectedStatus, recorder.Code)
location, err := recorder.Result().Location()
require.Error(t, err, "ghf %v", location)
require.Errorf(t, err, "Location %v", location)
}
}
})

View file

@ -125,7 +125,7 @@ type retryResponseWriterWithoutCloseNotify struct {
}
func (rr *retryResponseWriterWithoutCloseNotify) ShouldRetry() bool {
return *rr.netErrorOccured == true && !rr.attemptsExhausted
return *rr.netErrorOccured && !rr.attemptsExhausted
}
func (rr *retryResponseWriterWithoutCloseNotify) Header() http.Header {