Avoid go vet warning:

struct field tag `json:"..., omitempty"` not compatible with reflect.StructTag.Get: suspicious space in struct tag value
struct field tag `json:"...", omitempty` not compatible with reflect.StructTag.Get: key:"value" pairs not separated by spaces
This commit is contained in:
Holger Obermaier 2022-01-20 13:06:38 +01:00
parent cc35357957
commit 5cbd345a1d
8 changed files with 17 additions and 17 deletions

View File

@ -54,11 +54,11 @@ import (
type CentralConfigFile struct {
Interval int `json:"interval"`
Duration int `json:"duration"`
Pidfile string `json:"pidfile", omitempty`
Pidfile string `json:"pidfile,omitempty"`
CollectorConfigFile string `json:"collectors"`
RouterConfigFile string `json:"router"`
SinkConfigFile string `json:"sinks"`
ReceiverConfigFile string `json:"receivers", omitempty`
ReceiverConfigFile string `json:"receivers,omitempty"`
}
func LoadCentralConfiguration(file string, config *CentralConfigFile) error {

View File

@ -10,7 +10,7 @@ type ReceiverConfig struct {
Addr string `json:"address"`
Port string `json:"port"`
Database string `json:"database"`
Organization string `json:"organization", omitempty`
Organization string `json:"organization,omitempty"`
Type string `json:"type"`
}

View File

@ -7,14 +7,14 @@ import (
type sinkConfig struct {
Type string `json:"type"`
Host string `json:"host", omitempty`
Port string `json:"port", omitempty`
Host string `json:"host,omitempty"`
Port string `json:"port,omitempty"`
Database string `json:"database,omitempty"`
User string `json:"user,omitempty"`
Password string `json:"password", omitempty`
Organization string `json:"organization", omitempty`
SSL bool `json:"ssl", omitempty`
MetaAsTags bool `json:"meta_as_tags", omitempty`
Password string `json:"password,omitempty"`
Organization string `json:"organization,omitempty"`
SSL bool `json:"ssl,omitempty"`
MetaAsTags bool `json:"meta_as_tags,omitempty"`
}
type sink struct {