You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-08-09 15:42:47 +03:00
Improve linting (#861)
* Disable unused-parameter check due to false positives on Collect() calls. * Enable misspell. * Simplify error returns. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
@@ -115,10 +115,7 @@ func (c PGDatabaseCollector) Update(ctx context.Context, instance *instance, ch
|
||||
prometheus.GaugeValue, sizeMetric, datname,
|
||||
)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return rows.Err()
|
||||
}
|
||||
|
||||
func sliceContains(slice []string, s string) bool {
|
||||
|
@@ -126,8 +126,5 @@ func (PGReplicationSlotCollector) Update(ctx context.Context, instance *instance
|
||||
prometheus.GaugeValue, isActiveValue, slotNameLabel,
|
||||
)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return rows.Err()
|
||||
}
|
||||
|
@@ -218,8 +218,5 @@ func (PGStatIOUserTablesCollector) Update(ctx context.Context, instance *instanc
|
||||
datnameLabel, schemanameLabel, relnameLabel,
|
||||
)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return rows.Err()
|
||||
}
|
||||
|
Reference in New Issue
Block a user