mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
fix loading configuration from YAML files
This commit is contained in:
parent
a318aeea01
commit
318705017f
1 changed files with 3 additions and 3 deletions
|
@ -96,11 +96,11 @@ func InitConfig() error {
|
||||||
defaults := config.NewStatic(static)
|
defaults := config.NewStatic(static)
|
||||||
env := config.NewEnvironment(mappings)
|
env := config.NewEnvironment(mappings)
|
||||||
|
|
||||||
if _, err := os.Stat(*configFile); os.IsExist(err) {
|
if _, err := os.Stat(*configFile); os.IsNotExist(err) {
|
||||||
|
GolbalConfig = config.NewConfig([]config.Provider{defaults, env})
|
||||||
|
} else {
|
||||||
yamlFile := config.NewYAMLFile(*configFile)
|
yamlFile := config.NewYAMLFile(*configFile)
|
||||||
GolbalConfig = config.NewConfig([]config.Provider{defaults, yamlFile, env})
|
GolbalConfig = config.NewConfig([]config.Provider{defaults, yamlFile, env})
|
||||||
} else {
|
|
||||||
GolbalConfig = config.NewConfig([]config.Provider{defaults, env})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err := GolbalConfig.Load()
|
err := GolbalConfig.Load()
|
||||||
|
|
Loading…
Add table
Reference in a new issue