diff options
author | Emile <hanemile@protonmail.com> | 2019-03-06 16:05:39 +0100 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-03-06 16:05:39 +0100 |
commit | 8a5903414f928d3cb076635dc5972ce149862326 (patch) | |
tree | f15025347f4a7acd3a4212d189b6177e10fc6ffc | |
parent | 68f02566fbd645ee6f9b678a7d23e4cd1143d4f9 (diff) |
ConnectToDB now recieves the name of the database it connects to
-rw-r--r-- | db_actions.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db_actions.go b/db_actions.go index c6ed041..8a3bdf8 100644 --- a/db_actions.go +++ b/db_actions.go @@ -43,8 +43,8 @@ var ( ) // connectToDB returns a pointer to an sql database writing to the database -func ConnectToDB() *sql.DB { - connStr := fmt.Sprintf("user=%s dbname=%s sslmode=%s", DBUSER, DBNAME, DBSSLMODE) +func ConnectToDB(dbname) *sql.DB { + connStr := fmt.Sprintf("user=%s dbname=%s sslmode=%s", DBUSER, dbname, DBSSLMODE) db := dbConnect(connStr) return db } |