chore: fix warnings (#3989)

This commit is contained in:
Kevin Wan
2024-03-08 22:35:17 +08:00
committed by GitHub
parent 69bb746a1d
commit 159ecb7386
32 changed files with 64 additions and 61 deletions

View File

@@ -128,8 +128,8 @@ func (c *Cache) Take(key string, fetch func() (any, error)) (any, error) {
var fresh bool
val, err := c.barrier.Do(key, func() (any, error) {
// because O(1) on map search in memory, and fetch is an IO query
// so we do double check, cache might be taken by another call
// because O(1) on map search in memory, and fetch is an IO query,
// so we do double-check, cache might be taken by another call
if val, ok := c.doGet(key); ok {
return val, nil
}