From c2d03f470b3e28d9e9eb89e22c8023f2642e802c Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Mon, 3 Jul 2017 17:18:56 +0300 Subject: [PATCH] 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 --- go/loader/loader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/loader/loader.go b/go/loader/loader.go index 1cd4d6eb14..de756f7fcf 100644 --- a/go/loader/loader.go +++ b/go/loader/loader.go @@ -105,7 +105,7 @@ type Config struct { // 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.