gf/geg/database/gredis/gredis_conn_do_var.go

17 lines
245 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/g"
)
func main() {
conn := g.Redis().Conn()
defer conn.Close()
if _, err := conn.Do("SET", "k", "v"); err != nil {
panic(err)
}
v, _ := conn.DoVar("GET", "k")
fmt.Println(v.String())
}