imports: export VendorlessPath
Rename to avoid imports/import stutter and export.
It will be used soon by guru's referrers command.
This work supported by Sourcegraph.
Change-Id: Ibfc39d061d6269a336a59d9b6979188a94537d94
Reviewed-on: https://go-review.googlesource.com/108877
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/imports/fix.go b/imports/fix.go
index 73f939a..b164ca5 100644
--- a/imports/fix.go
+++ b/imports/fix.go
@@ -638,7 +638,7 @@
importpath := filepath.ToSlash(dir[len(srcDir)+len("/"):])
dirScan[dir] = &pkg{
importPath: importpath,
- importPathShort: vendorlessImportPath(importpath),
+ importPathShort: VendorlessPath(importpath),
dir: dir,
}
}
@@ -683,9 +683,9 @@
}
}
-// vendorlessImportPath returns the devendorized version of the provided import path.
+// VendorlessPath returns the devendorized version of the provided import path.
// e.g. "foo/bar/vendor/a/b" => "a/b"
-func vendorlessImportPath(ipath string) string {
+func VendorlessPath(ipath string) string {
// Devendorize for use in import statement.
if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 {
return ipath[i+len("/vendor/"):]