From 6103d0c66f9a80b1a2f7f5acdb70caf2622220ed Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Wed, 27 May 2020 07:54:47 +0200 Subject: [PATCH] Fix MDStat() error return Don't touch the ioutil error message so that the return can be tested with `os.IsNotExist()`. Related to https://github.com/prometheus/node_exporter/issues/1719 Signed-off-by: Ben Kochie --- mdstat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdstat.go b/mdstat.go index 2af3ada18..3e9362a94 100644 --- a/mdstat.go +++ b/mdstat.go @@ -52,7 +52,7 @@ type MDStat struct { func (fs FS) MDStat() ([]MDStat, error) { data, err := ioutil.ReadFile(fs.proc.Path("mdstat")) if err != nil { - return nil, fmt.Errorf("error parsing mdstat %s: %s", fs.proc.Path("mdstat"), err) + return nil, err } mdstat, err := parseMDStat(data) if err != nil {