From a2575b93a99fab51035e8ddc0c85c0c08d51f5d3 Mon Sep 17 00:00:00 2001 From: Ben Reedy Date: Wed, 15 May 2024 05:55:37 +1000 Subject: [PATCH] feat(ci): add unused linter Signed-off-by: Ben Reedy --- .golangci.yaml | 1 - pkg/collector/smbclient/smbclient.go | 8 -------- 2 files changed, 9 deletions(-) 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 -}