enable full linter across the codebase (#9620)

enable linter using golangci-lint across
codebase to run a bunch of linters together,
we shall enable new linters as we fix more
things the codebase.

This PR fixes the first stage of this
cleanup.
This commit is contained in:
Harshavardhana
2020-05-18 09:59:45 -07:00
committed by GitHub
parent 96009975d6
commit 1bc32215b9
39 changed files with 128 additions and 239 deletions

View File

@@ -21,7 +21,6 @@ import (
"context"
"encoding/json"
"io/ioutil"
"math"
"net/http"
"time"
)
@@ -128,23 +127,6 @@ func (adm *AdminClient) StorageInfo(ctx context.Context) (StorageInfo, error) {
return storageInfo, nil
}
type objectHistogramInterval struct {
name string
start, end int64
}
// ObjectsHistogramIntervals contains the list of intervals
// of an histogram analysis of objects sizes.
var ObjectsHistogramIntervals = []objectHistogramInterval{
{"LESS_THAN_1024_B", -1, 1024 - 1},
{"BETWEEN_1024_B_AND_1_MB", 1024, 1024*1024 - 1},
{"BETWEEN_1_MB_AND_10_MB", 1024 * 1024, 1024*1024*10 - 1},
{"BETWEEN_10_MB_AND_64_MB", 1024 * 1024 * 10, 1024*1024*64 - 1},
{"BETWEEN_64_MB_AND_128_MB", 1024 * 1024 * 64, 1024*1024*128 - 1},
{"BETWEEN_128_MB_AND_512_MB", 1024 * 1024 * 128, 1024*1024*512 - 1},
{"GREATER_THAN_512_MB", 1024 * 1024 * 512, math.MaxInt64},
}
// DataUsageInfo represents data usage of an Object API
type DataUsageInfo struct {
// LastUpdate is the timestamp of when the data usage info was last updated.