diff options
author | Akbar Rifai <ars.xda@gmail.com> | 2022-05-13 19:48:12 +0700 |
---|---|---|
committer | Akbar Rifai <ars.xda@gmail.com> | 2022-05-13 19:48:12 +0700 |
commit | 7cb35f7f7822d828fcd2c702eeeb4708837c2048 (patch) | |
tree | 2686dc3343442177b5858e7f933aba4de6092996 | |
parent | d3fc311d68f2c3f4c0a8e2e0a95a0dbce7594669 (diff) |
Ignore gopsutil host warnings
-rw-r--r-- | devices/temp_nix.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/devices/temp_nix.go b/devices/temp_nix.go index 0015e1d..488e16f 100644 --- a/devices/temp_nix.go +++ b/devices/temp_nix.go @@ -1,3 +1,4 @@ +//go:build linux || darwin // +build linux darwin package devices @@ -15,7 +16,11 @@ func init() { func getTemps(temps map[string]int) map[string]error { sensors, err := host.SensorsTemperatures() if err != nil { - return map[string]error{"gopsutil host": err} + if _, ok := err.(*host.Warnings); ok { + // ignore warnings + } else { + return map[string]error{"gopsutil host": err} + } } for _, sensor := range sensors { label := sensorMap[sensor.SensorKey] |