summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-02-11 18:19:30 +0100
committerxengineering <me@xengineering.eu>2023-02-11 18:19:30 +0100
commitced1e404bd762abb114321334a3812805dee7059 (patch)
tree27f6ac74a2de4bd020af17408cd19d9e0265a501 /config.go
parent05e3b3397c888807719d70af4ed3c73397d9374f (diff)
downloadceres-ced1e404bd762abb114321334a3812805dee7059.tar
ceres-ced1e404bd762abb114321334a3812805dee7059.tar.zst
ceres-ced1e404bd762abb114321334a3812805dee7059.zip
Apply go fmt *.go
This auto-applies the recommended Go codestyle.
Diffstat (limited to 'config.go')
-rw-r--r--config.go27
1 files changed, 13 insertions, 14 deletions
diff --git a/config.go b/config.go
index 645e347..e48016a 100644
--- a/config.go
+++ b/config.go
@@ -1,33 +1,32 @@
-
package main
import (
- "log"
+ "encoding/json"
"flag"
- "os"
"io/ioutil"
- "encoding/json"
+ "log"
+ "os"
"path/filepath"
)
type RuntimeConfig struct {
- Path string
- Http HttpConfig `json:"http"`
+ Path string
+ Http HttpConfig `json:"http"`
Database DatabaseConfig `json:"database"`
}
type HttpConfig struct {
- Host string `json:"bind_host"`
- Port string `json:"bind_port"`
- Static string `json:"static"`
+ Host string `json:"bind_host"`
+ Port string `json:"bind_port"`
+ Static string `json:"static"`
Templates string `json:"templates"`
- Storage string `json:"storage"`
+ Storage string `json:"storage"`
}
type DatabaseConfig struct {
- Socket string `json:"socket"`
- User string `json:"user"`
- Database string `json:"database"`
+ Socket string `json:"socket"`
+ User string `json:"user"`
+ Database string `json:"database"`
Migrations string `json:"migrations"`
}
@@ -59,7 +58,7 @@ func GetRuntimeConfig() RuntimeConfig {
log.Fatalf("Could not parse configuration file %s", config.Path)
}
- abs,err := filepath.Abs(config.Path)
+ abs, err := filepath.Abs(config.Path)
if err != nil {
log.Fatalf("Could not translate %s to absolute path.", config.Path)
}