From 9e3c585a28f20ad5d06ebe91f08cd805d6a43cf7 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sat, 18 Dec 2021 19:30:47 +0100 Subject: [PATCH] revive: Remove unnecessary = 0 from var declaration. See, ``` $ GOOS=windows GOARCH=amd64 golangci-lint run ./... 2>1 | grep var-declaration collector/os.go:205:22: var-declaration: should drop = 0 from declaration of var fsipf; it is the zero value (revive) collector/os.go:226:23: var-declaration: should drop = 0 from declaration of var pfbRaw; it is the zero value (revive) ``` Signed-off-by: Mario Trangoni --- collector/os.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/os.go b/collector/os.go index 2a55f7b0..27780b2f 100644 --- a/collector/os.go +++ b/collector/os.go @@ -202,7 +202,7 @@ func (c *OSCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) ( return nil, err } - var fsipf float64 = 0 + var fsipf float64 for _, pagingFile := range pagingFiles { fileString := strings.ReplaceAll(pagingFile, `\??\`, "") file, err := os.Stat(fileString) @@ -223,7 +223,7 @@ func (c *OSCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) ( } // Get current page file usage. - var pfbRaw float64 = 0 + var pfbRaw float64 for _, pageFile := range pfc { if strings.Contains(strings.ToLower(pageFile.Name), "_total") { continue