Skip to content

Commit dbc7fb3

Browse files
authored
search jpaths from right to left, compatibility with cpp (google#140)
1 parent 4356f42 commit dbc7fb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (importer *FileImporter) Import(dir, importedPath string) *ImportedData {
128128
return &ImportedData{err: err}
129129
}
130130

131-
for i := 0; !found && i < len(importer.JPaths); i++ {
131+
for i := len(importer.JPaths) - 1; !found && i >= 0; i-- {
132132
found, content, foundHere, err = tryPath(importer.JPaths[i], importedPath)
133133
if err != nil {
134134
return &ImportedData{err: err}

0 commit comments

Comments
 (0)