Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit 98d9612

Browse files
authored
Merge pull request #53 from karalabe/relative-imports
Resolve relative import paths.
2 parents 88b2cc6 + c509111 commit 98d9612

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

trash.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ func listImports(rootPackage, libRoot, pkg string) <-chan util.Packages {
475475
imp := v.Path.Value[1 : len(v.Path.Value)-1]
476476
if pkgComponents := strings.Split(imp, "/"); !strings.Contains(pkgComponents[0], ".") {
477477
continue
478+
} else if pkgComponents[0] == "." || pkgComponents[0] == ".." {
479+
imp = filepath.Clean(filepath.Join(pkg, imp))
478480
}
479481
if imp == rootPackage || strings.HasPrefix(imp, rootPackage+"/") {
480482
continue

0 commit comments

Comments
 (0)