diff --git a/.golangci.yaml b/.golangci.yaml index aa33b2c9..dd056c7b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -87,7 +87,6 @@ linters: - testpackage - thelper - tparallel - - unused - usestdlibvars - varnamelen - wastedassign diff --git a/pkg/collector/smbclient/smbclient.go b/pkg/collector/smbclient/smbclient.go index 94cb6ded..93381b6c 100644 --- a/pkg/collector/smbclient/smbclient.go +++ b/pkg/collector/smbclient/smbclient.go @@ -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 -}