Fix linter issues: unconvert

This commit is contained in:
Cody Soyland 2018-07-20 11:51:55 -05:00
parent c7e29b48f9
commit dc50204846
6 changed files with 8 additions and 7 deletions

View file

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

View file

@ -262,8 +262,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

@ -1072,9 +1072,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 {