From 8bf7f37fca1ae3b633e78ff5181851d9ec76a6a7 Mon Sep 17 00:00:00 2001 From: Yalcin Ozbek Date: Sat, 5 Nov 2022 16:40:39 +0300 Subject: [PATCH] the code has been moved before append Signed-off-by: Yalcin Ozbek --- cpu/cpu_linux.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/cpu_linux.go b/cpu/cpu_linux.go index 165a34dde..44bf1ce4f 100644 --- a/cpu/cpu_linux.go +++ b/cpu/cpu_linux.go @@ -285,10 +285,6 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { c.Microcode = value } } - if c.CPU >= 0 { - finishCPUInfo(&c) - ret = append(ret, c) - } if c.VendorID == "ARM" && c.ModelName == "" { if v, err := strconv.ParseUint(c.Model, 0, 16); err == nil { modelName, exist := armModelToModelName[v] @@ -299,6 +295,10 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { } } } + if c.CPU >= 0 { + finishCPUInfo(&c) + ret = append(ret, c) + } return ret, nil }