Package list golang-github-stvp-tempredis / 5003a0b5-1400-4e7f-af12-e236ffc098f9/main example_test.go
5003a0b5-1400-4e7f-af12-e236ffc098f9/main

Tree @5003a0b5-1400-4e7f-af12-e236ffc098f9/main (Download .tar.gz)

example_test.go @5003a0b5-1400-4e7f-af12-e236ffc098f9/mainraw · 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")
}