Avoid go vet warning:

struct field tag `json:"..., omitempty"` not compatible with reflect.StructTag.Get: suspicious space in struct tag value
This commit is contained in:
Holger Obermaier 2022-01-20 12:38:52 +01:00
parent 8860b8d0f7
commit 5d263addde
5 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ import (
const CPUSTATFILE = `/proc/stat` const CPUSTATFILE = `/proc/stat`
type CpustatCollectorConfig struct { type CpustatCollectorConfig struct {
ExcludeMetrics []string `json:"exclude_metrics, omitempty"` ExcludeMetrics []string `json:"exclude_metrics,omitempty"`
} }
type CpustatCollector struct { type CpustatCollector struct {

View File

@ -15,7 +15,7 @@ const DISKSTATFILE = `/proc/diskstats`
const DISKSTAT_SYSFSPATH = `/sys/block` const DISKSTAT_SYSFSPATH = `/sys/block`
type DiskstatCollectorConfig struct { type DiskstatCollectorConfig struct {
ExcludeMetrics []string `json:"exclude_metrics, omitempty"` ExcludeMetrics []string `json:"exclude_metrics,omitempty"`
} }
type DiskstatCollector struct { type DiskstatCollector struct {

View File

@ -20,7 +20,7 @@ const LIDFILE = `/sys/class/infiniband/mlx4_0/ports/1/lid`
const PERFQUERY = `/usr/sbin/perfquery` const PERFQUERY = `/usr/sbin/perfquery`
type InfinibandCollectorConfig struct { type InfinibandCollectorConfig struct {
ExcludeDevices []string `json:"exclude_devices, omitempty"` ExcludeDevices []string `json:"exclude_devices,omitempty"`
PerfQueryPath string `json:"perfquery_path"` PerfQueryPath string `json:"perfquery_path"`
} }

View File

@ -12,7 +12,7 @@ import (
const LOADAVGFILE = `/proc/loadavg` const LOADAVGFILE = `/proc/loadavg`
type LoadavgCollectorConfig struct { type LoadavgCollectorConfig struct {
ExcludeMetrics []string `json:"exclude_metrics, omitempty"` ExcludeMetrics []string `json:"exclude_metrics,omitempty"`
} }
type LoadavgCollector struct { type LoadavgCollector struct {

View File

@ -11,8 +11,8 @@ import (
) )
type NvidiaCollectorConfig struct { type NvidiaCollectorConfig struct {
ExcludeMetrics []string `json:"exclude_metrics, omitempty"` ExcludeMetrics []string `json:"exclude_metrics,omitempty"`
ExcludeDevices []string `json:"exclude_devices, omitempty"` ExcludeDevices []string `json:"exclude_devices,omitempty"`
} }
type NvidiaCollector struct { type NvidiaCollector struct {