Skip to content

Commit 7514bf8

Browse files
tpoundsjirfag
authored andcommitted
Fix AST cache key consistency.
Ensures the AST cache always consistently loads/stores by using the normalized file path as the key.
1 parent a5c44d2 commit 7514bf8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/lint/astcache/astcache.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,12 @@ func (c *Cache) loadFromPackage(pkg *packages.Package) {
129129
continue
130130
}
131131

132-
c.m[pos.Filename] = &File{
132+
filePath := c.normalizeFilename(pos.Filename)
133+
134+
c.m[filePath] = &File{
133135
F: f,
134136
Fset: pkg.Fset,
135-
Name: pos.Filename,
137+
Name: filePath,
136138
}
137139
}
138140
}

0 commit comments

Comments
 (0)