-
Notifications
You must be signed in to change notification settings - Fork 574
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