From 88e785e04b6402646d53689a5ac62fd899299399 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Tue, 13 Nov 2018 01:41:08 +0000 Subject: [PATCH] Remove some unneeded database attributes --- app.go | 10 ++-------- config/config.go | 4 ---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app.go b/app.go index 0ef9146..94406e1 100644 --- a/app.go +++ b/app.go @@ -203,15 +203,9 @@ func Serve() { app.formDecoder.RegisterConverter(sql.NullFloat64{}, converter.ConvertSQLNullFloat64) // Check database configuration - if app.cfg.Database.User == "" || app.cfg.Database.Password == "" { - log.Error("Database user or password not set.") - os.Exit(1) - } - if app.cfg.Database.Host == "" { - app.cfg.Database.Host = "localhost" - } if app.cfg.Database.Database == "" { - app.cfg.Database.Database = "writeas" + log.Error("Database filename not set.") + os.Exit(1) } connectToDatabase(app) diff --git a/config/config.go b/config/config.go index 3dfb7c2..a2e7838 100644 --- a/config/config.go +++ b/config/config.go @@ -18,11 +18,7 @@ type ( DatabaseCfg struct { Type string `ini:"type"` - User string `ini:"username"` - Password string `ini:"password"` Database string `ini:"database"` - Host string `ini:"host"` - Port int `ini:"port"` } AppCfg struct {