go/loader: Fix thinko in FindPackage hook signature
(*build.Context).Import has signature of
(ctx, importPath, fromDir, mode)
not
(ctx, fromDir, importPath, mode)
and the loader actually uses the first version.
The thinko was introduced in d6e83e53 (go/loader: changes for vendor
support; CL 18053) and was possible because importPath and fromDir both
have the same type string.
Fix it.
Change-Id: I52deaec6d141846b8a495835b121c1bdc2864215
Reviewed-on: https://go-review.googlesource.com/47343
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/go/loader/loader.go b/go/loader/loader.go
index 1cd4d6e..de756f7 100644
--- a/go/loader/loader.go
+++ b/go/loader/loader.go
@@ -105,7 +105,7 @@
// conventions, for example.
//
// It must be safe to call concurrently from multiple goroutines.
- FindPackage func(ctxt *build.Context, fromDir, importPath string, mode build.ImportMode) (*build.Package, error)
+ FindPackage func(ctxt *build.Context, importPath, fromDir string, mode build.ImportMode) (*build.Package, error)
// AfterTypeCheck is called immediately after a list of files
// has been type-checked and appended to info.Files.