gf/.example/database/gredis/gredis_conn_send_var.go

21 lines
303 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
conn := g.Redis().Conn()
defer conn.Close()
conn.Send("SET", "foo", "bar")
conn.Send("GET", "foo")
conn.Flush()
// reply from SET
conn.Receive()
// reply from GET
v, _ := conn.ReceiveVar()
fmt.Println(v.String())
}