chore(deps): update dependency golangci/golangci-lint to v2.2.1 (#2110)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
renovate[bot]
2025-07-05 00:08:07 +02:00
committed by GitHub
parent 7a4e92a473
commit 9320e992cc
58 changed files with 516 additions and 46 deletions

View File

@@ -217,6 +217,7 @@ func (c *Collector) convertMetricFamily(logger *slog.Logger, metricFamily *dto.M
for _, q := range metric.GetSummary().GetQuantile() {
quantiles[q.GetQuantile()] = q.GetValue()
}
ch <- prometheus.MustNewConstSummary(
prometheus.NewDesc(
metricFamily.GetName(),
@@ -232,6 +233,7 @@ func (c *Collector) convertMetricFamily(logger *slog.Logger, metricFamily *dto.M
for _, b := range metric.GetHistogram().GetBucket() {
buckets[b.GetUpperBound()] = b.GetCumulativeCount()
}
ch <- prometheus.MustNewConstHistogram(
prometheus.NewDesc(
metricFamily.GetName(),
@@ -290,8 +292,8 @@ type carriageReturnFilteringReader struct {
// Read returns data from the underlying io.Reader, but with \r filtered out.
func (cr carriageReturnFilteringReader) Read(p []byte) (int, error) {
buf := make([]byte, len(p))
n, err := cr.r.Read(buf)
n, err := cr.r.Read(buf)
if err != nil && err != io.EOF {
return n, err
}
@@ -356,7 +358,6 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
return nil
})
if err != nil && directory != "" {
errs = append(errs, fmt.Errorf("error reading textfile directory %q: %w", directory, err))
}

View File

@@ -119,6 +119,7 @@ func TestDuplicateMetricEntry(t *testing.T) {
}
var duplicateFamily []*dto.MetricFamily
duplicateFamily = append(duplicateFamily, &duplicate)
// Ensure detection for duplicate metrics

View File

@@ -51,6 +51,7 @@ func TestMultipleDirectories(t *testing.T) {
got := ""
errCh := make(chan error, 1)
go func() {
errCh <- textFileCollector.Collect(metrics)
@@ -88,6 +89,7 @@ func TestDuplicateFileName(t *testing.T) {
got := ""
errCh := make(chan error, 1)
go func() {
errCh <- textFileCollector.Collect(metrics)