diff options
author | xengineering <me@xengineering.eu> | 2023-02-11 13:46:45 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-02-11 13:46:45 +0100 |
commit | 6b52b4bbc81c64b29daff043b83e21c38f332052 (patch) | |
tree | 3a5d41f75228fe6ece3df5c109365d54b0ba6d04 /main.go | |
parent | 312c59564700da719dbafad11c2d9f647b46d912 (diff) | |
download | ceres-6b52b4bbc81c64b29daff043b83e21c38f332052.tar ceres-6b52b4bbc81c64b29daff043b83e21c38f332052.tar.zst ceres-6b52b4bbc81c64b29daff043b83e21c38f332052.zip |
Switch to global database pointer
Passing the database pointer around is a lot of text and has no benefit.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -3,13 +3,15 @@ package main import ( "log" + "database/sql" ) var config RuntimeConfig +var db *sql.DB func main() { config = GetRuntimeConfig() log.Printf("Starting ceres with config file '%s'\n", config.Path) - db := InitDatabase() - runServer(&db) + db = setupDatabase() + runServer() } |