4 "github.com/gofrs/flock"
7 // Locks the file that backs the given key.
9 // If the call is successful, it's the caller's responsibility to call Unlock on the returned lock.
10 func (cd *CacheDir) Lock(key ...CacheKey) (*flock.Flock, error) {
11 l := flock.New(cd.cachePath(key...))