You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
327 B
Go

package redistab
import "github.com/go-redis/redis"
var RedisClient *redis.Client
func init() {
RedisClient = redis.NewClient(&redis.Options{
Addr: "127.0.0.1:6379",
Password: "123456",
PoolSize: 20,
DB: 1,
})
// 检测
_, err := RedisClient.Ping().Result()
if err != nil {
panic(err)
return
}
}