package redis import ( "fmt" "testing" "time" ) func TestRedis(t *testing.T) { redis, err := New(&Config{ Addr: "127.0.0.1:6379", Password: "", DB: 15, PoolSize: 16, MinIdleConn: 4, MaxConnAge: "1h", IdleTimeout: "10m", }) if err != nil { fmt.Println(err) return } defer redis.Close() set, err := redis.Set("name", "qwe123", time.Minute) if err != nil { fmt.Println(err) return } fmt.Println(set) get, err := redis.Get("name") if err != nil { fmt.Println(err) return } fmt.Println(get) }