From dbf25cdd857e3b71a26d9fc7bbd29354068da791 Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Sun, 3 Feb 2019 20:11:28 -0800 Subject: [PATCH] Fix temperatures not showing (#101, #103) Sometimes a temperature sensor file in `/sys/class/hwmon/hwmon*/temp*_*` will return 'ENETDOWN: Network is down' when being read for some reason, which gopsutil propogates up to gotop. gopsutil still returns a slice of valid temperatures when it errors, so we can render those instead of ignoring the return value. --- src/widgets/temp_other.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/temp_other.go b/src/widgets/temp_other.go index 0e5de36c..db30de43 100644 --- a/src/widgets/temp_other.go +++ b/src/widgets/temp_other.go @@ -13,8 +13,7 @@ import ( func (self *Temp) update() { sensors, err := psHost.SensorsTemperatures() if err != nil { - log.Printf("failed to get sensors from gopsutil: %v", err) - return + log.Printf("error recieved from gopsutil: %v", err) } for _, sensor := range sensors { // only sensors with input in their name are giving us live temp info