mirror of
https://github.com/prometheus/prometheus
synced 2025-04-08 02:21:52 +00:00
ci(lint): enable predeclared linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
92d6980360
commit
c8e7f95a3c
@ -13,8 +13,9 @@ linters:
|
|||||||
- gocritic
|
- gocritic
|
||||||
- gofumpt
|
- gofumpt
|
||||||
- goimports
|
- goimports
|
||||||
- revive
|
|
||||||
- misspell
|
- misspell
|
||||||
|
- predeclared
|
||||||
|
- revive
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
- unused
|
||||||
|
|
||||||
|
@ -216,9 +216,9 @@ func (ce *CircularExemplarStorage) ValidateExemplar(l labels.Labels, e exemplar.
|
|||||||
return ce.validateExemplar(seriesLabels, e, false)
|
return ce.validateExemplar(seriesLabels, e, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not thread safe. The append parameters tells us whether this is an external validation, or internal
|
// Not thread safe. The appended parameters tells us whether this is an external validation, or internal
|
||||||
// as a result of an AddExemplar call, in which case we should update any relevant metrics.
|
// as a result of an AddExemplar call, in which case we should update any relevant metrics.
|
||||||
func (ce *CircularExemplarStorage) validateExemplar(key []byte, e exemplar.Exemplar, append bool) error {
|
func (ce *CircularExemplarStorage) validateExemplar(key []byte, e exemplar.Exemplar, appended bool) error {
|
||||||
if len(ce.exemplars) == 0 {
|
if len(ce.exemplars) == 0 {
|
||||||
return storage.ErrExemplarsDisabled
|
return storage.ErrExemplarsDisabled
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ func (ce *CircularExemplarStorage) validateExemplar(key []byte, e exemplar.Exemp
|
|||||||
}
|
}
|
||||||
|
|
||||||
if e.Ts <= ce.exemplars[idx.newest].exemplar.Ts {
|
if e.Ts <= ce.exemplars[idx.newest].exemplar.Ts {
|
||||||
if append {
|
if appended {
|
||||||
ce.metrics.outOfOrderExemplars.Inc()
|
ce.metrics.outOfOrderExemplars.Inc()
|
||||||
}
|
}
|
||||||
return storage.ErrOutOfOrderExemplar
|
return storage.ErrOutOfOrderExemplar
|
||||||
|
@ -244,9 +244,9 @@ type txRing struct {
|
|||||||
txIDCount int // How many ids in the ring.
|
txIDCount int // How many ids in the ring.
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTxRing(cap int) *txRing {
|
func newTxRing(capacity int) *txRing {
|
||||||
return &txRing{
|
return &txRing{
|
||||||
txIDs: make([]uint64, cap),
|
txIDs: make([]uint64, capacity),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user