server: Fix CI build complaints (#4119)

- Ineffassign fixes.
- Spell check correction.
master
Karthic Rao 8 years ago committed by Harshavardhana
parent a7afa469e2
commit 5f065e2a96
  1. 4
      cmd/admin-rpc-client_test.go
  2. 2
      cmd/endpoint_test.go
  3. 4
      cmd/web-handlers_test.go
  4. 2
      cmd/xl-v1-healing-common_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)
}

@ -86,7 +86,7 @@ func TestNewEndpoint(t *testing.T) {
} else if err == nil {
t.Fatalf("error: expected = %v, got = <nil>", testCase.expectedErr)
} else {
match := false
var match bool
if strings.HasSuffix(testCase.expectedErr.Error(), errMsg) {
match = strings.HasSuffix(err.Error(), errMsg)
} else {

@ -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")
}

@ -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) {

Loading…
Cancel
Save