feat(ci): add unused linter

Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
Ben Reedy 2024-05-15 05:55:37 +10:00
parent 965be334bc
commit a2575b93a9
No known key found for this signature in database
GPG Key ID: 235C15B6086C9D7E
2 changed files with 0 additions and 9 deletions

View File

@ -87,7 +87,6 @@ linters:
- testpackage
- thelper
- tparallel
- unused
- usestdlibvars
- varnamelen
- wastedassign

View File

@ -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
}