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

@ -20,7 +20,6 @@ import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"regexp"
"strconv"
@ -86,7 +85,7 @@ func getMemInfoNuma() ([]meminfoMetric, error) {
return nil, err
}
for _, node := range nodes {
meminfoFile, err := os.Open(path.Join(node, "meminfo"))
meminfoFile, err := os.Open(filepath.Join(node, "meminfo"))
if err != nil {
return nil, err
}
@ -98,7 +97,7 @@ func getMemInfoNuma() ([]meminfoMetric, error) {
}
metrics = append(metrics, numaInfo...)
numastatFile, err := os.Open(path.Join(node, "numastat"))
numastatFile, err := os.Open(filepath.Join(node, "numastat"))
if err != nil {
return nil, err
}