瀏覽代碼

fix nil bug

Paul 6 年之前
父節點
當前提交
8ca2f9ebce
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      middleware/auth/session_redis.go

+ 1
- 1
middleware/auth/session_redis.go 查看文件

@@ -12,7 +12,7 @@ type RedisSessionStore struct {
12 12
 }
13 13
 
14 14
 func NewRedisSessionStore(address string, password string) *RedisSessionStore {
15
-	session := &RedisSessionStore{}
15
+	session := &RedisSessionStore{once:&sync.Once{}}
16 16
 	session.once.Do(func() {
17 17
 		session.client = redis.NewClient(&redis.Options{
18 18
 			Addr:     address,