summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-02-11 18:31:50 +0100
committerxengineering <me@xengineering.eu>2023-02-11 18:31:50 +0100
commita288826b924266ff4577003103ef49cf6bb5cc3c (patch)
treec20106aee80e78e7f3873a5f149b7bf9c955e1c0 /config.go
parentced1e404bd762abb114321334a3812805dee7059 (diff)
downloadceres-a288826b924266ff4577003103ef49cf6bb5cc3c.tar
ceres-a288826b924266ff4577003103ef49cf6bb5cc3c.tar.zst
ceres-a288826b924266ff4577003103ef49cf6bb5cc3c.zip
Remove most function-inline comments
Docstrings for functions are a good thing. But the inside of a function should be written in a way that is self-explaining. Thus inline comments are just extra stuff to maintain and read.
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)