-
Notifications
You must be signed in to change notification settings - Fork 571
Go Example (redigo)
Josh Baker edited this page Jan 2, 2017
·
6 revisions
go get github.com/garyburd/redigo/redis
package main
import (
"fmt"
"log"
"github.com/garyburd/redigo/redis"
)
func main() {
c, err := redis.Dial("tcp", ":9851")
if err != nil {
log.Fatalf("Could not connect: %v\n", err)
}
defer c.Close()
ret, _ := c.Do("SET","fleet", "truck1", "POINT", "33", "-115")
fmt.Printf("%s\n", ret)
ret, _ = c.Do("GET","fleet", "truck1")
fmt.Printf("%s\n", ret)
}
Thanks to Jonatan Reiners for providing this example code