Skip to content

Commit d33a4f6

Browse files
committed
module resolve
1 parent bcf514a commit d33a4f6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ACCESS_SECRET=hello
2-
RedisAddr=REDIS_DB=localhost:6379
2+
RedisAddr=localhost:6379
33
GIN_PORT=8080
44
REFRESH_SECRET=hello

config/init.go

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package config
2+
3+
import (
4+
"github.com/HelpDeskPlatform/gin-jwt/db"
5+
"log"
6+
)
7+
8+
func InIt() {
9+
SetEnvironment()
10+
if err := db.NewDatabase(RedisAddr); err != nil {
11+
log.Println(err)
12+
}
13+
}

main.go

-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ func initEnv() {
2121
}
2222
}
2323

24-
func InIt() {
25-
config.SetEnvironment()
26-
if err := db.NewDatabase(config.RedisAddr); err != nil {
27-
log.Println(err)
28-
}
29-
}
30-
3124
func init() {
3225
initEnv()
3326
}

0 commit comments

Comments
 (0)