From 81527693ec4d570943ba3e1e8ffc2c54c2eb5647 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 23 Apr 2018 09:37:30 -0700 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Alan Donovan --- imports/fix.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imports/fix.go b/imports/fix.go index 73f939a1..b164ca53 100644 --- a/imports/fix.go +++ b/imports/fix.go @@ -638,7 +638,7 @@ func scanGoDirs(goRoot bool) { importpath := filepath.ToSlash(dir[len(srcDir)+len("/"):]) dirScan[dir] = &pkg{ importPath: importpath, - importPathShort: vendorlessImportPath(importpath), + importPathShort: VendorlessPath(importpath), dir: dir, } } @@ -683,9 +683,9 @@ func scanGoDirs(goRoot bool) { } } -// 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/"):]