mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-22 19:26:56 -08:00
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:
parent
1fb0c8b688
commit
069ceeaefb
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue