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

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2019-01-21 11:44:55 -05:00 committed by Ben Kochie
parent e766485286
commit 3b5c2f6463

View file

@ -14,10 +14,10 @@
package collector package collector
import ( import (
"path" "path/filepath"
"github.com/prometheus/procfs" "github.com/prometheus/procfs"
"gopkg.in/alecthomas/kingpin.v2" kingpin "gopkg.in/alecthomas/kingpin.v2"
) )
var ( var (
@ -28,13 +28,13 @@ var (
) )
func procFilePath(name string) string { func procFilePath(name string) string {
return path.Join(*procPath, name) return filepath.Join(*procPath, name)
} }
func sysFilePath(name string) string { func sysFilePath(name string) string {
return path.Join(*sysPath, name) return filepath.Join(*sysPath, name)
} }
func rootfsFilePath(name string) string { func rootfsFilePath(name string) string {
return path.Join(*rootfsPath, name) return filepath.Join(*rootfsPath, name)
} }