Matheus 6 lat temu
rodzic
commit
90dc110056
2 zmienionych plików z 7 dodań i 4 usunięć
  1. 3 0
      .gometalinter
  2. 4 4
      core/database/database.go

+ 3 - 0
.gometalinter

@@ -0,0 +1,3 @@
1
+{
2
+  "Exclude": ["exported \\w+ (\\S*['.]*)([a-zA-Z'.*]*) should have comment or be unexported"]
3
+}

+ 4 - 4
core/database/database.go

@@ -1,4 +1,4 @@
1
-package models
1
+package database
2 2
 
3 3
 import (
4 4
 	"database/sql"
@@ -7,19 +7,19 @@ import (
7 7
 	_ "github.com/go-sql-driver/mysql"
8 8
 )
9 9
 
10
-var db *sql.DB
10
+var DB *sql.DB
11 11
 
12 12
 func Init(dataSourceName string) error {
13 13
 
14 14
 	var err error
15 15
 
16
-	db, err = sql.Open("mysql", dataSourceName)
16
+	DB, err = sql.Open("mysql", dataSourceName)
17 17
 
18 18
 	if err != nil {
19 19
 		log.Panic(err)
20 20
 	}
21 21
 
22
-	if err = db.Ping(); err != nil {
22
+	if err = DB.Ping(); err != nil {
23 23
 		log.Panic(err)
24 24
 	}
25 25