From b0cd5b87dc41a1b9ae7ad243613a387efc96456e Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Fri, 10 Sep 2021 22:37:52 +0100 Subject: [PATCH] Use a boolean variable for retry fail --- pkg/carddav/backoff_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/carddav/backoff_test.go b/pkg/carddav/backoff_test.go index e83c590..2ee137b 100644 --- a/pkg/carddav/backoff_test.go +++ b/pkg/carddav/backoff_test.go @@ -10,10 +10,10 @@ import ( ) func TestBackoff(t *testing.T) { - requestCount := 0 + requestShouldFail := true testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - requestCount++ - if requestCount < 2 { + if requestShouldFail { + requestShouldFail = false w.WriteHeader(http.StatusInternalServerError) return }