标签:blank def pre dig ref 开源 microsoft main pack
1、安装导入
使用第三方开源的redis库: github.com/garyburd/redigo/redis
go get github.com/garyburd/redigo/redis import "github.com/garyburd/redigo/redis"
github:https://github.com/antirez/redis
Doc:http://godoc.org/github.com/garyburd/redigo/redis
2、连接
package main import ( "fmt" "github.com/garyburd/redigo/redis" ) func main() { c, err := redis.Dial("tcp", "localhost:6379") if err != nil { fmt.Println("conn redis failed,", err) return } defer c.Close() }
标签:blank def pre dig ref 开源 microsoft main pack
原文地址:http://www.cnblogs.com/shhnwangjian/p/7504832.html