daemon/config.New(): rewrite to be slightly more idiomatic

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-07-10 14:55:23 +02:00
parent 5588a78ab3
commit 0ff80c844d
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -282,10 +282,14 @@ func (conf *Config) IsValueSet(name string) bool {
// New returns a new fully initialized Config struct
func New() *Config {
config := Config{}
config.LogConfig.Config = make(map[string]string)
config.ClusterOpts = make(map[string]string)
return &config
return &Config{
CommonConfig: CommonConfig{
LogConfig: LogConfig{
Config: make(map[string]string),
},
ClusterOpts: make(map[string]string),
},
}
}
// ParseClusterAdvertiseSettings parses the specified advertise settings