Fix linter errors after linter update

Updated linter golangci-lint from 1.45 to 1.50 previously

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2023-01-08 17:10:18 +01:00
parent 1fb0c8b688
commit 069ceeaefb
2 changed files with 2 additions and 9 deletions

View file

@ -151,7 +151,7 @@ func newPreventDoubleCloseIndexWriter(iw IndexWriter) *preventDoubleCloseIndexWr
}
func (p *preventDoubleCloseIndexWriter) Close() error {
if p.closed.CAS(false, true) {
if p.closed.CompareAndSwap(false, true) {
return p.IndexWriter.Close()
}
return nil
@ -167,7 +167,7 @@ func newPreventDoubleCloseChunkWriter(cw ChunkWriter) *preventDoubleCloseChunkWr
}
func (p *preventDoubleCloseChunkWriter) Close() error {
if p.closed.CAS(false, true) {
if p.closed.CompareAndSwap(false, true) {
return p.ChunkWriter.Close()
}
return nil

View file

@ -858,13 +858,6 @@ func (c *PostingsCloner) Clone() Postings {
return newListPostings(c.ids...)
}
// seriesRefSlice attaches the methods of sort.Interface to []storage.SeriesRef, sorting in increasing order.
type seriesRefSlice []storage.SeriesRef
func (x seriesRefSlice) Len() int { return len(x) }
func (x seriesRefSlice) Less(i, j int) bool { return x[i] < x[j] }
func (x seriesRefSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
// FindIntersectingPostings checks the intersection of p and candidates[i] for each i in candidates,
// if intersection is non empty, then i is added to the indexes returned.
// Returned indexes are not sorted.