MCPcopy Index your code
hub / github.com/rclone/rclone / GetMaybe

Method GetMaybe

lib/cache/cache.go:149–158  ·  view source on GitHub ↗

GetMaybe returns the key and true if found, nil and false if not

(key string)

Source from the content-addressed store, hash-verified

147
148// GetMaybe returns the key and true if found, nil and false if not
149func (c *Cache) GetMaybe(key string) (value any, found bool) {
150 c.mu.Lock()
151 defer c.mu.Unlock()
152 entry, found := c.cache[key]
153 if !found {
154 return nil, found
155 }
156 c.used(entry)
157 return entry.value, found
158}
159
160// Delete the entry passed in
161//

Callers 8

isLibraryInCacheMethod · 0.80
mkLibraryMethod · 0.80
ListEntriesMethod · 0.80
ListEntriesMethod · 0.80
TestGetMaybeFunction · 0.80
CallMethod · 0.80
GetMethod · 0.80
TestRunFunction · 0.80

Calls 3

usedMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by 2

TestGetMaybeFunction · 0.64
TestRunFunction · 0.64