Files
gf/.example/os/gcache/note_interface_key.go
2021-10-11 21:41:56 +08:00

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))
}