gf/.example/database/gredis/gredis_conn_do.go

17 lines
244 B
Go
Raw Normal View History

2019-03-21 23:51:57 +08:00
package main
import (
2019-04-03 00:03:46 +08:00
"fmt"
2019-07-29 21:01:19 +08:00
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
2019-03-21 23:51:57 +08:00
)
func main() {
2019-04-03 00:03:46 +08:00
conn := g.Redis().Conn()
defer conn.Close()
conn.Do("SET", "k", "v")
v, _ := conn.Do("GET", "k")
fmt.Println(gconv.String(v))
2019-03-21 23:51:57 +08:00
}