From 5f065e2a96f552a76314e347e84bbe181f647cc7 Mon Sep 17 00:00:00 2001 From: Karthic Rao Date: Fri, 14 Apr 2017 20:30:04 +0530 Subject: [PATCH] server: Fix CI build complaints (#4119) - Ineffassign fixes. - Spell check correction. --- cmd/admin-rpc-client_test.go | 4 ++-- cmd/endpoint_test.go | 2 +- cmd/web-handlers_test.go | 4 ++-- cmd/xl-v1-healing-common_test.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/admin-rpc-client_test.go b/cmd/admin-rpc-client_test.go index 6bd360a72..fa6ecda94 100644 --- a/cmd/admin-rpc-client_test.go +++ b/cmd/admin-rpc-client_test.go @@ -245,7 +245,7 @@ func TestGetValidServerConfig(t *testing.T) { // Invalid config - no quorum. serverConfigs = []serverConfigV13{c1, c2, c2, c1} - validConfig, err = getValidServerConfig(serverConfigs, noErrs) + _, err = getValidServerConfig(serverConfigs, noErrs) if err != errXLWriteQuorum { t.Errorf("Expected to fail due to lack of quorum but received %v", err) } @@ -253,7 +253,7 @@ func TestGetValidServerConfig(t *testing.T) { // All errors allErrs := []error{errDiskNotFound, errDiskNotFound, errDiskNotFound, errDiskNotFound} serverConfigs = []serverConfigV13{{}, {}, {}, {}} - validConfig, err = getValidServerConfig(serverConfigs, allErrs) + _, err = getValidServerConfig(serverConfigs, allErrs) if err != errXLWriteQuorum { t.Errorf("Expected to fail due to lack of quorum but received %v", err) } diff --git a/cmd/endpoint_test.go b/cmd/endpoint_test.go index 73f5f8319..8f69c3162 100644 --- a/cmd/endpoint_test.go +++ b/cmd/endpoint_test.go @@ -86,7 +86,7 @@ func TestNewEndpoint(t *testing.T) { } else if err == nil { t.Fatalf("error: expected = %v, got = ", testCase.expectedErr) } else { - match := false + var match bool if strings.HasSuffix(testCase.expectedErr.Error(), errMsg) { match = strings.HasSuffix(err.Error(), errMsg) } else { diff --git a/cmd/web-handlers_test.go b/cmd/web-handlers_test.go index ffe9c9bed..72e172dc2 100644 --- a/cmd/web-handlers_test.go +++ b/cmd/web-handlers_test.go @@ -867,11 +867,11 @@ func testWebHandlerDownloadZip(obj ObjectLayer, instanceType string, t TestErrHa apiRouter.ServeHTTP(rec, req) return rec.Code, rec.Body.Bytes() } - code, data := test("") + code, _ := test("") if code != 403 { t.Fatal("Expected to receive authentication error") } - code, data = test(authorization) + code, data := test(authorization) if code != 200 { t.Fatal("web.DownloadsZip() failed") } diff --git a/cmd/xl-v1-healing-common_test.go b/cmd/xl-v1-healing-common_test.go index 7a3c63db7..bceb35dfb 100644 --- a/cmd/xl-v1-healing-common_test.go +++ b/cmd/xl-v1-healing-common_test.go @@ -272,7 +272,7 @@ func TestListOnlineDisks(t *testing.T) { partsMetadata := partsMetaFromModTimes(test.modTimes, xlMeta.Erasure.Checksum) onlineDisks, modTime := listOnlineDisks(xlDisks, partsMetadata, test.errs) - availableDisks, newErrs, err := disksWithAllParts(onlineDisks, partsMetadata, test.errs, bucket, object) + availableDisks, newErrs, _ := disksWithAllParts(onlineDisks, partsMetadata, test.errs, bucket, object) test.errs = newErrs outdatedDisks := outDatedDisks(xlDisks, availableDisks, test.errs, partsMetadata, bucket, object) if modTime.Equal(timeSentinel) {