Package list golang-github-stvp-tempredis / debian/0.0_git20160122.0.83f7aae-2 example_test.go
debian/0.0_git20160122.0.83f7aae-2

Tree @debian/0.0_git20160122.0.83f7aae-2 (Download .tar.gz)

example_test.go @debian/0.0_git20160122.0.83f7aae-2raw · history · blame

package tempredis

import (
	"github.com/garyburd/redigo/redis"
)

func ExampleUsage() {
	server, err := Start(Config{"databases": "8"})
	if err != nil {
		panic(err)
	}
	defer server.Term()

	conn, err := redis.Dial("unix", server.Socket())
	defer conn.Close()
	if err != nil {
		panic(err)
	}

	conn.Do("SET", "foo", "bar")
}