From 458f6dec086422a0ba114b2c2a8900f24131c29a Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Thu, 20 Jan 2022 12:38:52 +0100 Subject: [PATCH] Avoid go vet warning: struct field tag `json:"..., omitempty"` not compatible with reflect.StructTag.Get: suspicious space in struct tag value --- collectors/cpustatMetric.go | 2 +- collectors/diskstatMetric.go | 2 +- collectors/infinibandMetric.go | 2 +- collectors/loadavgMetric.go | 2 +- collectors/nvidiaMetric.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/collectors/cpustatMetric.go b/collectors/cpustatMetric.go index fe31c3c..9e44fa7 100644 --- a/collectors/cpustatMetric.go +++ b/collectors/cpustatMetric.go @@ -13,7 +13,7 @@ import ( const CPUSTATFILE = `/proc/stat` type CpustatCollectorConfig struct { - ExcludeMetrics []string `json:"exclude_metrics, omitempty"` + ExcludeMetrics []string `json:"exclude_metrics,omitempty"` } type CpustatCollector struct { diff --git a/collectors/diskstatMetric.go b/collectors/diskstatMetric.go index e2d2f25..5080ca2 100644 --- a/collectors/diskstatMetric.go +++ b/collectors/diskstatMetric.go @@ -15,7 +15,7 @@ const DISKSTATFILE = `/proc/diskstats` const DISKSTAT_SYSFSPATH = `/sys/block` type DiskstatCollectorConfig struct { - ExcludeMetrics []string `json:"exclude_metrics, omitempty"` + ExcludeMetrics []string `json:"exclude_metrics,omitempty"` } type DiskstatCollector struct { diff --git a/collectors/infinibandMetric.go b/collectors/infinibandMetric.go index 54c974e..a9552f7 100644 --- a/collectors/infinibandMetric.go +++ b/collectors/infinibandMetric.go @@ -20,7 +20,7 @@ const LIDFILE = `/sys/class/infiniband/mlx4_0/ports/1/lid` const PERFQUERY = `/usr/sbin/perfquery` type InfinibandCollectorConfig struct { - ExcludeDevices []string `json:"exclude_devices, omitempty"` + ExcludeDevices []string `json:"exclude_devices,omitempty"` PerfQueryPath string `json:"perfquery_path"` } diff --git a/collectors/loadavgMetric.go b/collectors/loadavgMetric.go index dbccf22..21cf350 100644 --- a/collectors/loadavgMetric.go +++ b/collectors/loadavgMetric.go @@ -12,7 +12,7 @@ import ( const LOADAVGFILE = `/proc/loadavg` type LoadavgCollectorConfig struct { - ExcludeMetrics []string `json:"exclude_metrics, omitempty"` + ExcludeMetrics []string `json:"exclude_metrics,omitempty"` } type LoadavgCollector struct { diff --git a/collectors/nvidiaMetric.go b/collectors/nvidiaMetric.go index 4597610..bd63e2c 100644 --- a/collectors/nvidiaMetric.go +++ b/collectors/nvidiaMetric.go @@ -11,8 +11,8 @@ import ( ) type NvidiaCollectorConfig struct { - ExcludeMetrics []string `json:"exclude_metrics, omitempty"` - ExcludeDevices []string `json:"exclude_devices, omitempty"` + ExcludeMetrics []string `json:"exclude_metrics,omitempty"` + ExcludeDevices []string `json:"exclude_devices,omitempty"` } type NvidiaCollector struct {