Skip to content

Instantly share code, notes, and snippets.

@xiaojay
Created July 5, 2013 15:33
Show Gist options
  • Save xiaojay/5935331 to your computer and use it in GitHub Desktop.
Save xiaojay/5935331 to your computer and use it in GitHub Desktop.
go for redis
package main
import(
"fmt"
"github.com/vmihailenco/redis"
)
func main(){
password := ""
db := int64(-1)
client := redis.NewTCPClient("localhost:6379", password, db)
defer client.Close()
set := client.Set("foo", "bar")
fmt.Println(set.Err(), set.Val())
get := client.Get("foo")
fmt.Println(get.Err(), get.Val())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment