From e8e6434446cc88d7850f158d3c016d4039b25e81 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Mon, 16 Nov 2020 20:40:47 -0500 Subject: [PATCH] Fix more golint warnings. No issue # Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- sdk/go/keepclient/keepclient.go | 2 +- sdk/go/keepclient/keepclient_test.go | 2 +- sdk/go/keepclient/support.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/go/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go index ec56e902c8..21913ff967 100644 --- a/sdk/go/keepclient/keepclient.go +++ b/sdk/go/keepclient/keepclient.go @@ -227,7 +227,7 @@ func (kc *KeepClient) getOrHead(method string, locator string, header http.Heade var retryList []string for triesRemaining > 0 { - triesRemaining -= 1 + triesRemaining-- retryList = nil for _, host := range serversToTry { diff --git a/sdk/go/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go index 8d595fbe14..59c4127240 100644 --- a/sdk/go/keepclient/keepclient_test.go +++ b/sdk/go/keepclient/keepclient_test.go @@ -209,7 +209,7 @@ func (fh *FailThenSucceedHandler) ServeHTTP(resp http.ResponseWriter, req *http. fh.reqIDs = append(fh.reqIDs, req.Header.Get("X-Request-Id")) if fh.count == 0 { resp.WriteHeader(500) - fh.count += 1 + fh.count++ fh.handled <- fmt.Sprintf("http://%s", req.Host) } else { fh.successhandler.ServeHTTP(resp, req) diff --git a/sdk/go/keepclient/support.go b/sdk/go/keepclient/support.go index 6a31c98bc6..91117f2d32 100644 --- a/sdk/go/keepclient/support.go +++ b/sdk/go/keepclient/support.go @@ -161,7 +161,7 @@ func (this *KeepClient) putReplicas( lastError := make(map[string]string) for retriesRemaining > 0 { - retriesRemaining -= 1 + retriesRemaining-- nextServer = 0 retryServers = []string{} for replicasTodo > 0 { @@ -170,8 +170,8 @@ func (this *KeepClient) putReplicas( if nextServer < len(sv) { DebugPrintf("DEBUG: [%s] Begin upload %s to %s", reqid, hash, sv[nextServer]) go this.uploadToKeepServer(sv[nextServer], hash, getReader(), uploadStatusChan, expectedLength, reqid) - nextServer += 1 - active += 1 + nextServer++ + active++ } else { if active == 0 && retriesRemaining == 0 { msg := "Could not write sufficient replicas: " @@ -190,7 +190,7 @@ func (this *KeepClient) putReplicas( // Now wait for something to happen. if active > 0 { status := <-uploadStatusChan - active -= 1 + active-- if status.statusCode == 200 { // good news! -- 2.30.2