first commit
This commit is contained in:
23
calculate/cal.go
Normal file
23
calculate/cal.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user