collector: use path/filepath for handling file paths (#1245)

Similar to #1228.  Update the remaining collectors to use
'path/filepath' intead of 'path' for manipulating file paths.

Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
Paul Gier 2019-02-05 09:37:27 -06:00 committed by Ben Kochie
commit 2b81bff518
5 changed files with 26 additions and 29 deletions

View file

@ -17,7 +17,7 @@ package collector
import (
"fmt"
"path"
"path/filepath"
"github.com/prometheus/client_golang/prometheus"
)
@ -62,7 +62,7 @@ func NewKsmdCollector() (Collector, error) {
// Update implements Collector and exposes kernel and system statistics.
func (c *ksmdCollector) Update(ch chan<- prometheus.Metric) error {
for _, n := range ksmdFiles {
val, err := readUintFromFile(sysFilePath(path.Join("kernel/mm/ksm", n)))
val, err := readUintFromFile(sysFilePath(filepath.Join("kernel/mm/ksm", n)))
if err != nil {
return err
}