fix condition for nil pointer in common config

This commit is contained in:
Willy Kloucek
2022-01-12 12:38:41 +01:00
parent 2f8d63b380
commit 6ef6d1117c
14 changed files with 26 additions and 26 deletions

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -24,7 +24,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -35,7 +35,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -23,7 +23,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &shared.Log{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -423,7 +423,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config, storageExtension string) er
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &shared.Log{}
}

View File

@@ -24,7 +24,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -35,7 +35,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -24,7 +24,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -35,7 +35,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}

View File

@@ -25,7 +25,7 @@ func ParseConfig(cfg *config.Config) error {
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
@@ -36,7 +36,7 @@ func ParseConfig(cfg *config.Config) error {
Endpoint: cfg.Commons.Tracing.Endpoint,
Collector: cfg.Commons.Tracing.Collector,
}
} else if cfg.Tracing == nil && cfg.Commons == nil {
} else if cfg.Tracing == nil {
cfg.Tracing = &config.Tracing{}
}