Skip to content

Commit

Permalink
bug:The parameter of the New method is a pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Zh1Cheung committed Mar 27, 2021
1 parent bb68832 commit 93a01a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .example/database/gredis/gredis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (

// 使用原生gredis.New操作redis,但是注意需要自己调用Close方法关闭redis链接池
func main() {
redis := gredis.New(gredis.Config{
config := &gredis.Config{
Host: "127.0.0.1",
Port: 6379,
})
}
redis := gredis.New(config)
defer redis.Close()
redis.Do("SET", "k", "v")
v, _ := redis.Do("GET", "k")
Expand Down

0 comments on commit 93a01a1

Please sign in to comment.