mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-25 07:52:05 +00:00
feat(ci): add unused linter
Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
parent
965be334bc
commit
a2575b93a9
@ -87,7 +87,6 @@ linters:
|
||||
- testpackage
|
||||
- thelper
|
||||
- tparallel
|
||||
- unused
|
||||
- usestdlibvars
|
||||
- varnamelen
|
||||
- wastedassign
|
||||
|
@ -285,7 +285,6 @@ func (c *collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
|
||||
return err
|
||||
}
|
||||
for _, instance := range data {
|
||||
// labelName := c.toLabelName(instance.Name)
|
||||
if instance.Name == "_Total" {
|
||||
continue
|
||||
}
|
||||
@ -446,10 +445,3 @@ func (c *collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// toLabelName converts strings to lowercase and replaces all whitespaces and dots with underscores
|
||||
func (c *collector) toLabelName(name string) string {
|
||||
s := strings.ReplaceAll(strings.Join(strings.Fields(strings.ToLower(name)), "_"), ".", "_")
|
||||
s = strings.ReplaceAll(s, "__", "_")
|
||||
return s
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user