From 17e34352f9b4f85818664c8f996a63d69974c2fa Mon Sep 17 00:00:00 2001 From: michaellindman Date: Sat, 13 Jul 2019 13:53:27 +0100 Subject: [PATCH] removed unused database config --- database.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 database.go diff --git a/database.go b/database.go deleted file mode 100644 index 34efcab..0000000 --- a/database.go +++ /dev/null @@ -1,40 +0,0 @@ -package request - -import ( - "database/sql" - "fmt" - "log" -) - -func dbConnect() *sql.DB { - resp := Option().Database - db, err := sql.Open("mysql", resp.User+":"+resp.Passwd+"@tcp("+resp.Server+")/"+resp.Db) - if err != nil { - fmt.Println(err) - } else { - fmt.Println("Connection Established") - } - return db -} - -func GetUser(id int) { - var email string - db := dbConnect() - rows, err := db.Query("select request_id, email from gdpr_requests where request_id = ?", 1) - if err != nil { - log.Fatal(err) - } - defer db.Close() - for rows.Next() { - err := rows.Scan(&id, &email) - if err != nil { - log.Fatal(err) - } - fmt.Println(id, email) - } - err = rows.Err() - if err != nil { - log.Fatal(err) - } - defer db.Close() -}