Files
2025-11-24 11:18:08 +08:00

24 lines
368 B
Go

package calculate
import (
"context"
"fmt"
"github.com/go-redis/redis/v8"
)
var ctx = context.Background()
func Calculate() {
client := redis.NewClient(&redis.Options{
Addr: "mayimingperson.com:7000",
Password: "",
DB: 0,
})
Pong, eror := client.Ping(ctx).Result()
if eror != nil {
fmt.Println("redis连接失败")
}
fmt.Println(Pong)
}