From 84c644609403850e1cba92d069e8df507766782a Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Wed, 29 Jan 2020 23:14:34 +0100 Subject: [PATCH] netdev: clean zero-value assignments Signed-off-by: Julien Pivotto --- collector/netdev_common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/netdev_common.go b/collector/netdev_common.go index e634c90c..21644695 100644 --- a/collector/netdev_common.go +++ b/collector/netdev_common.go @@ -50,12 +50,12 @@ func NewNetDevCollector(logger log.Logger) (Collector, error) { return nil, errors.New("device-blacklist & accept-devices are mutually exclusive") } - var ignorePattern *regexp.Regexp = nil + var ignorePattern *regexp.Regexp if *netdevIgnoredDevices != "" { ignorePattern = regexp.MustCompile(*netdevIgnoredDevices) } - var acceptPattern *regexp.Regexp = nil + var acceptPattern *regexp.Regexp if *netdevAcceptDevices != "" { acceptPattern = regexp.MustCompile(*netdevAcceptDevices) }