Merge pull request #1544 from codysoyland/1517-metalinter-unconvert

Fix linter issues: unconvert
This commit is contained in:
Cody Soyland 2018-08-02 12:17:27 -05:00 • committed by GitHub
commit 205857e765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 7 deletions

View file

@ -124,6 +124,7 @@ gometalinter: require-gometalinter
--enable=megacheck \
--enable=misspell \
--enable=nakedret \
--enable=unconvert \
--enable=unparam \
--enable=vet \
--exclude "^internal/.*\.pb\.go" \

View file

@ -257,8 +257,8 @@ func (s *attrStore) BlockData(i uint64) (map[uint64]map[string]interface{}, erro
defer tx.Rollback()
// Move to the start of the block.
min := u64tob(uint64(i) * attrBlockSize)
max := u64tob(uint64(i+1) * attrBlockSize)
min := u64tob(i * attrBlockSize)
max := u64tob((i + 1) * attrBlockSize)
cur := tx.Bucket([]byte("attrs")).Cursor()
for k, v := cur.Seek(min); k != nil; k, v = cur.Next() {
// Exit if we're past the end of the block.

View file

@ -114,7 +114,7 @@ func (c *lruCache) Top() []bitmapPair {
for id, n := range c.counts {
a = append(a, bitmapPair{
ID: id,
Count: uint64(n),
Count: n,
})
}
sort.Sort(bitmapPairs(a))

View file

@ -1000,9 +1000,9 @@ func (f *Field) importValue(columnIDs []uint64, values []int64) error {
dataByFragment := make(map[importKey]importValueData)
for i := range columnIDs {
columnID, value := columnIDs[i], values[i]
if int64(value) > bsig.Max {
if value > bsig.Max {
return fmt.Errorf("%v, columnID=%v, value=%v", ErrBSIGroupValueTooHigh, columnID, value)
} else if int64(value) < bsig.Min {
} else if value < bsig.Min {
return fmt.Errorf("%v, columnID=%v, value=%v", ErrBSIGroupValueTooLow, columnID, value)
}

View file

@ -230,7 +230,7 @@ func (m *Command) SetupServer() error {
diagnosticsInterval := time.Duration(0)
if m.Config.Metric.Diagnostics {
diagnosticsInterval = time.Duration(defaultDiagnosticsInterval)
diagnosticsInterval = defaultDiagnosticsInterval
}
statsClient, err := newStatsClient(m.Config.Metric.Service, m.Config.Metric.Host)

View file

@ -862,7 +862,7 @@ func (idx *index) lookupKey(offset int64) []byte {
func (idx *index) alloc(capacity uint64) {
idx.elems = make([]elem, capacity)
idx.threshold = (capacity * uint64(idx.loadFactor)) / 100
idx.mask = uint64(capacity - 1)
idx.mask = capacity - 1
}
func (idx *index) dist(hash, i uint64) uint64 {