diff --git a/cpu/cpu_freebsd.go b/cpu/cpu_freebsd.go index 877fe7e..7d0321f 100644 --- a/cpu/cpu_freebsd.go +++ b/cpu/cpu_freebsd.go @@ -146,7 +146,7 @@ func Info() ([]InfoStat, error) { func parseDmesgBoot(fileName string) (InfoStat, int, error) { c := InfoStat{} lines, _ := common.ReadLines(fileName) - var cpuNum int + cpuNum := 1 // default cpu num is 1 for _, line := range lines { if matches := cpuEnd.FindStringSubmatch(line); matches != nil { break