我尝试连接到 REDIS SENTINEL 的代码。由于我是 golang 新手,想澄清我出了什么问题?REDIS SENTINEL 已配置并正常工作。
package main
import (
"fmt"
"github.com/go-redis/redis"
)
func main() {
rdb:=redis.NewFailoverClient(&redis.FailoverOptions(
MasterName: "mymaster",
SentinelAddrs: "XXX.XXX.XXX.XXX:26379","XXX.XXX.XXX.XXX:26379","XXX.XXX.XXX.XXX:26379",
))
rdb.Ping()
}
跑步:
$ go run redis.go
**# command-line-arguments**
>./redif.go:11:12: syntax error: unexpected :, expecting comma or )**
Cats萌萌
相关分类