mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
20 lines
296 B
Go
20 lines
296 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/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())
|
|
}
|