mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-26 08:22:07 +00:00
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 <mjtrangoni@gmail.com>
This commit is contained in:
parent
e4a43c539b
commit
9e3c585a28
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user