mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
20 lines
343 B
Go
20 lines
343 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/v2/os/gcache"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
)
|
|
|
|
func main() {
|
|
var (
|
|
ctx = gctx.New()
|
|
key1 int32 = 1
|
|
key2 float64 = 1
|
|
value = `value`
|
|
)
|
|
_ = gcache.Ctx(ctx).Set(key1, value, 0)
|
|
fmt.Println(gcache.Ctx(ctx).Get(key1))
|
|
fmt.Println(gcache.Ctx(ctx).Get(key2))
|
|
}
|