2020
12-22
12-22
golang-redis之sorted set类型操作详解
1:安装redigogogetgithub.com/garyburd/redigo/redis2:引用redigoimport("github.com/garyburd/redigo/redis")3:连接Redisc,err:=redis.Dial("tcp","192.168.2.225:6379")iferr!=nil{fmt.Println("connecttorediserr",err.Error())return}deferc.Close()4:命令n,err:=c.Do("zadd","key","score","member")//写result,err:=redis.Values(c.Do("zrange","key",0,-1))//读5:sortedset简单操作zadd(...
继续阅读 >