【升级go 1.18】

This commit is contained in:
PandaGoAdmin
2022-07-13 11:54:54 +08:00
parent 2e18999587
commit 433ee08634
60 changed files with 253 additions and 248 deletions

8
base/cache/cache.go vendored
View File

@@ -2,17 +2,17 @@ package cache
type Cache interface {
// 添加缓存,如果缓存则返回错误
Add(k string, v interface{}) error
Add(k string, v any) error
// 如果不存在则添加缓存值,否则直接返回
AddIfAbsent(k string, v interface{})
AddIfAbsent(k string, v any)
// 如果存在则直接返回否则调用getValue回调函数获取值并添加该缓存值
// @return 缓存值
ComputeIfAbsent(k string, getValueFunc func(string) (interface{}, error)) (interface{}, error)
ComputeIfAbsent(k string, getValueFunc func(string) (any, error)) (any, error)
// 获取缓存值参数1为值参数2->是否存在该缓存
Get(k string) (interface{}, bool)
Get(k string) (any, bool)
// 缓存数量
Count() int