mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-21 13:51:00 +02:00
Merge pull request #16998 from mmorel-35/govet/enable-all
chore: enable-all rule from govet
This commit is contained in:
commit
3fc87f40e8
@ -28,6 +28,7 @@ linters:
|
||||
- fatcontext
|
||||
- gocritic
|
||||
- godot
|
||||
- govet
|
||||
- loggercheck
|
||||
- misspell
|
||||
- nilnesserr
|
||||
@ -108,6 +109,11 @@ linters:
|
||||
- (*net/http.Server).Shutdown
|
||||
# Never check for rollback errors as Rollback() is called when a previous error was detected.
|
||||
- (github.com/prometheus/prometheus/storage.Appender).Rollback
|
||||
govet:
|
||||
disable:
|
||||
- shadow
|
||||
- fieldalignment
|
||||
enable-all: true
|
||||
perfsprint:
|
||||
# Optimizes even if it requires an int or uint type cast.
|
||||
int-conversion: true
|
||||
|
@ -221,10 +221,8 @@ func (d *discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
|
||||
}
|
||||
}
|
||||
d.oldSourceList = newSourceList
|
||||
if err == nil {
|
||||
// We're returning all Consul services as a single targetgroup.
|
||||
ch <- tgs
|
||||
}
|
||||
// Wait for ticker or exit when ctx is closed.
|
||||
select {
|
||||
case <-c:
|
||||
|
@ -39,10 +39,9 @@ func TestRecoverEvaluatorRuntime(t *testing.T) {
|
||||
require.Contains(t, output.String(), "sum(up)")
|
||||
}()
|
||||
defer ev.recover(expr, nil, &err)
|
||||
|
||||
// Cause a runtime panic.
|
||||
var a []int
|
||||
a[123] = 1
|
||||
a[123] = 1 //nolint:govet // This is intended to cause a runtime panic.
|
||||
}
|
||||
|
||||
func TestRecoverEvaluatorError(t *testing.T) {
|
||||
|
@ -5526,7 +5526,7 @@ func TestRecoverParserRuntime(t *testing.T) {
|
||||
defer p.recover(&err)
|
||||
// Cause a runtime panic.
|
||||
var a []int
|
||||
a[123] = 1
|
||||
a[123] = 1 //nolint:govet // This is intended to cause a runtime panic.
|
||||
}
|
||||
|
||||
func TestRecoverParserError(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user