We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a0ae07 commit 726d96eCopy full SHA for 726d96e
cmd/ecomm-api/main.go
@@ -1,6 +1,19 @@
1
package main
2
3
+import (
4
+ "github.com/bloodgroup-cplusplus/ecomm/db"
5
+)
6
func main() {
- db.NewDatabase()
7
+ db, err := db.NewDatabase()
8
+ if err != nil {
9
+ log.Fatal("Error opening database :%v",err)
10
+ }
11
+ defer db.Close()
12
+ log.Prinln("Successfully connected to database")
13
+
14
+ // do something with the databawse
15
}
16
17
18
19
0 commit comments