From 29aaf679daa52e877c6596422a06916c343dae41 Mon Sep 17 00:00:00 2001
From: Burcu Dogan <jbd@google.com>
Date: Mon, 12 Oct 2015 01:02:51 -0700
Subject: [PATCH] cmd/go: always log dynamic import errors

There is no easy way to understand what user intent was and whether
they wanted to use a dynamic import or not.

If we skip logging such errors, it breaks common use cases such as
https://golang.org/issue/12810.

It's a better approach to expose the underlying mechanism and
be more verbose with the error messages.

Fixes #12810.

Change-Id: I7e922c9e848382690d9d9b006d7046e6cf93223b
Reviewed-on: https://go-review.googlesource.com/15756
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
---
 src/cmd/go/vcs.go | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/cmd/go/vcs.go b/src/cmd/go/vcs.go
index 28a7540dfe..a1100960bf 100644
--- a/src/cmd/go/vcs.go
+++ b/src/cmd/go/vcs.go
@@ -567,16 +567,8 @@ func repoRootForImportPath(importPath string, security securityMode) (*repoRoot,
 			lookup = lookup[:i]
 		}
 		rr, err = repoRootForImportDynamic(lookup, security)
-
-		// repoRootForImportDynamic returns error detail
-		// that is irrelevant if the user didn't intend to use a
-		// dynamic import in the first place.
-		// Squelch it.
 		if err != nil {
-			if buildV {
-				log.Printf("import %q: %v", importPath, err)
-			}
-			err = fmt.Errorf("unrecognized import path %q", importPath)
+			err = fmt.Errorf("unrecognized import path %q (%v)", importPath, err)
 		}
 	}
 	if err != nil {
-- 
2.30.9