version v2.3.0 (#2392)

* v2.3.0

* up

* up

* up
This commit is contained in:
John Guo
2023-01-11 19:19:41 +08:00
committed by GitHub
parent 5e72b03b0a
commit 6ff4ed84e5
36 changed files with 511 additions and 260 deletions

View File

@ -0,0 +1,4 @@
redis:
default:
address: 127.0.0.1:6379
db: 1

View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
)
func main() {
var ctx = gctx.New()
_, err := g.Redis().Set(ctx, "key", "value")
if err != nil {
g.Log().Fatal(ctx, err)
}
value, err := g.Redis().Get(ctx, "key")
if err != nil {
g.Log().Fatal(ctx, err)
}
fmt.Println(value.String())
}