File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ type block struct {
3434var vscDirs = []string {".git" , ".hg" , ".bzr" , ".svn" }
3535
3636type cacheEntry struct {
37- file string
38- err error
37+ dir string
38+ err error
3939}
4040
4141var pkgCache = map [string ]cacheEntry {}
@@ -46,16 +46,16 @@ func findFile(filePath string) (string, error) {
4646 dir , file := filepath .Split (filePath )
4747 var result cacheEntry
4848 var ok bool
49- if result , ok = pkgCache [filePath ]; ! ok {
49+ if result , ok = pkgCache [dir ]; ! ok {
5050 pkg , err := build .Import (dir , "." , build .FindOnly )
5151 if err == nil {
52- result = cacheEntry {filepath .Join (pkg .Dir , file ), nil }
52+ result = cacheEntry {filepath .Join (pkg .Dir ), nil }
5353 } else {
5454 result = cacheEntry {"" , err }
5555 }
56- pkgCache [filePath ] = result
56+ pkgCache [dir ] = result
5757 }
58- return result .file , result .err
58+ return filepath . Join ( result .dir , file ) , result .err
5959}
6060
6161// findRepositoryRoot finds the VCS root dir of a given dir
You can’t perform that action at this time.
0 commit comments