We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c24c69b commit 73d430dCopy full SHA for 73d430d
pkg/cache/cache.go
@@ -42,17 +42,17 @@ func New() *Cache {
42
}
43
44
// Put adds or replaces a document in the cache.
45
-func (c *Cache) Put(new *Document) error {
+func (c *Cache) Put(doc *Document) error {
46
c.mu.Lock()
47
defer c.mu.Unlock()
48
49
- uri := new.Item.URI
+ uri := doc.Item.URI
50
if old, ok := c.docs[uri]; ok {
51
- if old.Item.Version > new.Item.Version {
+ if old.Item.Version > doc.Item.Version {
52
return errors.New("newer version of the document is already in the cache")
53
54
55
- c.docs[uri] = new
+ c.docs[uri] = doc
56
57
// Invalidate the TopLevelObject cache
58
// We can't easily invalidate the cache for a single file (hard to figure out where the import actually leads),
0 commit comments