gf/geg/database/redis/gredis2.go

16 lines
335 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"fmt"
"gitee.com/johng/gf/g"
"gitee.com/johng/gf/g/util/gconv"
)
// 使用框架封装的g.Redis()方法获得redis操作对象单例不需要开发者显示调用Close方法
func main() {
g.Redis().Do("SET", "k", "v")
v, _ := g.Redis().Do("GET", "k")
fmt.Println(gconv.String(v))
}