From f4f4e85aff948dd8d9816f2a8259aeef49fd2e46 Mon Sep 17 00:00:00 2001 From: rdyer Date: Tue, 3 Sep 2019 09:00:09 -0400 Subject: [PATCH] Handle case when CPU stepping is "unknown" --- cpu/cpu_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu/cpu_linux.go b/cpu/cpu_linux.go index be98dd7..588d7b3 100644 --- a/cpu/cpu_linux.go +++ b/cpu/cpu_linux.go @@ -168,7 +168,8 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return ret, err + // "stepping" might be 'unknown', so set to 0 in that case + c.Stepping = 0 } c.Stepping = int32(t) case "cpu MHz", "clock":