mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
21 lines
303 B
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())
|
|
}
|