summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/config.go b/config.go
index e48016a..4b5ecf0 100644
--- a/config.go
+++ b/config.go
@@ -32,27 +32,23 @@ type DatabaseConfig struct {
func GetRuntimeConfig() RuntimeConfig {
- // init empty return value
config := RuntimeConfig{}
- // read command line flags
- flag.StringVar(&config.Path, "c", "/etc/ceres/config.json", "Path to ceres configuration file")
+ flag.StringVar(&config.Path, "c", "/etc/ceres/config.json",
+ "Path to ceres configuration file")
flag.Parse()
- // open config file
configFile, err := os.Open(config.Path)
defer configFile.Close()
if err != nil {
log.Fatalf("Could not open configuration file %s", config.Path)
}
- // read byte content
configData, err := ioutil.ReadAll(configFile)
if err != nil {
log.Fatalf("Could not read configuration file %s", config.Path)
}
- // parse content to config structs
err = json.Unmarshal(configData, &config)
if err != nil {
log.Fatalf("Could not parse configuration file %s", config.Path)