Compare commits
2 commits
ccf3981d8d
...
99c57bd538
Author | SHA1 | Date | |
---|---|---|---|
Bendodroid | 99c57bd538 | ||
Bendodroid | 366504894d |
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
envConfigPath = "CONFIG_PATH"
|
envConfigPath = "SPACEAPID_CONFIG_PATH"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pathsT []string
|
type pathsT []string
|
||||||
|
@ -59,7 +59,7 @@ func getConfigPaths() (paths pathsT) {
|
||||||
|
|
||||||
// If paths is still empty we are missing something
|
// If paths is still empty we are missing something
|
||||||
if len(paths) == 0 {
|
if len(paths) == 0 {
|
||||||
log.Fatalln("Neither the env variable nor cli flag was specified, we are missing a config file.")
|
log.Fatalln("Error: Neither env: ", envConfigPath, "nor cli flag was specified, unable to start without config.")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ func ParseConfiguration() (conf SpaceapidConfig) {
|
||||||
log.Fatalln("Provided file doesn't specify compatibility with API version 14")
|
log.Fatalln("Provided file doesn't specify compatibility with API version 14")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialise fields for environment sensors
|
// Initialize fields for environment sensors
|
||||||
conf.Response.Sensors = make(map[string][]types.EnvironmentSensor)
|
conf.Response.Sensors = make(map[string][]types.EnvironmentSensor)
|
||||||
for key, sensorConfigs := range conf.Dynamic.Sensors {
|
for key, sensorConfigs := range conf.Dynamic.Sensors {
|
||||||
conf.Response.Sensors[key] = make([]types.EnvironmentSensor, len(sensorConfigs))
|
conf.Response.Sensors[key] = make([]types.EnvironmentSensor, len(sensorConfigs))
|
||||||
|
|
Loading…
Reference in a new issue