From c861ba93aaa40f5915e1a2eacf6729e7ab887e62 Mon Sep 17 00:00:00 2001 From: Park Beomsu Date: Mon, 15 Nov 2021 19:23:49 +0900 Subject: [PATCH] Remove redundant nil check (#2206) Signed-off-by: computerphilosopher --- collector/cpu_linux.go | 5 +---- collector/drm_linux.go | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index 2ddb9c4b..84ad373b 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go @@ -142,10 +142,7 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { if err := c.updateStat(ch); err != nil { return err } - if err := c.updateThermalThrottle(ch); err != nil { - return err - } - return nil + return c.updateThermalThrottle(ch) } // updateInfo reads /proc/cpuinfo diff --git a/collector/drm_linux.go b/collector/drm_linux.go index 21a0314e..11b8c628 100644 --- a/collector/drm_linux.go +++ b/collector/drm_linux.go @@ -99,11 +99,7 @@ func NewDrmCollector(logger log.Logger) (Collector, error) { } func (c *drmCollector) Update(ch chan<- prometheus.Metric) error { - if err := c.updateAMDCards(ch); err != nil { - return err - } - - return nil + return c.updateAMDCards(ch) } func (c *drmCollector) updateAMDCards(ch chan<- prometheus.Metric) error {