server: Fix CI build complaints (#4119)

- Ineffassign fixes.
- Spell check correction.
This commit is contained in:
Karthic Rao 2017-04-14 20:30:04 +05:30 committed by Harshavardhana
parent a7afa469e2
commit 5f065e2a96
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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