From d1fa279105a638b0f0f9b41f94e012fe109d8498 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Fri, 16 Dec 2016 11:45:14 +0100 Subject: [PATCH] Use a descriptive name for the file descriptor. --- collector/drbd_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/collector/drbd_linux.go b/collector/drbd_linux.go index a0a2684f..f51186fc 100644 --- a/collector/drbd_linux.go +++ b/collector/drbd_linux.go @@ -157,7 +157,7 @@ func NewDrbdCollector() (Collector, error) { func (c *drbdCollector) Update(ch chan<- prometheus.Metric) (err error) { statsFile := procFilePath("drbd") - f, err := os.Open(statsFile) + file, err := os.Open(statsFile) if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting DRBD statistics, as %s does not exist: %s", statsFile) @@ -165,9 +165,9 @@ func (c *drbdCollector) Update(ch chan<- prometheus.Metric) (err error) { } return err } - defer f.Close() + defer file.Close() - scanner := bufio.NewScanner(f) + scanner := bufio.NewScanner(file) scanner.Split(bufio.ScanWords) device := "unknown" for scanner.Scan() {