mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-21 12:09:03 +02:00
chore(deps): update dependency golangci/golangci-lint to v2.13.1 (master) (#2477)
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
Jan-Otto Kröpke
parent
2743d4e3f7
commit
75b0c11bb4
@@ -304,7 +304,7 @@ func deduplicateIISNames[T collectorName](counterValues []T) {
|
||||
|
||||
// Use map to deduplicate IIS entries
|
||||
for index, counterValue := range counterValues {
|
||||
name := strings.Split(counterValue.GetName(), "#")[0]
|
||||
name, _, _ := strings.Cut(counterValue.GetName(), "#")
|
||||
if name == counterValue.GetName() {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ func (c *Collector) collectObject(ch chan<- prometheus.Metric, perfDataObject Ob
|
||||
continue
|
||||
}
|
||||
|
||||
metricType, _ := field.Interface().(prometheus.ValueType)
|
||||
metricType, _ := reflect.TypeAssert[prometheus.ValueType](field)
|
||||
|
||||
labels := make(prometheus.Labels, len(counter.Labels)+1)
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ func (c *Collector) groupPrintJobs(printJobs []wmiPrintJob) map[PrintJobStatusGr
|
||||
groupedPrintJobs := make(map[PrintJobStatusGroup]int)
|
||||
|
||||
for _, printJob := range printJobs {
|
||||
printerName := strings.Split(printJob.Name, ",")[0]
|
||||
printerName, _, _ := strings.Cut(printJob.Name, ",")
|
||||
|
||||
if c.config.PrinterExclude.MatchString(printerName) ||
|
||||
!c.config.PrinterInclude.MatchString(printerName) {
|
||||
|
||||
Reference in New Issue
Block a user