components/golang/patches/0013-release-branch.go1.5-cmd-go-properly-ignore-import-c.patch
15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
22228656 remove redundant declarations and additions from makefiles
22252545 simplify build rules for components from common upstream
22378457 tclConfig.sh compiler settings are too specific
22727315 httping curses gui missing
22750630 procmail ignores userland cflags and may use private strstr function
22758725 wdiff uses diff from PATH instead of /usr/gnu/bin/diff
22926847 cloog Makefile typo when setting ASLR_MODE
22935090 tk config script has wrong linker flags
From 1d11801f40a4c1d61e1766f239e8ea908222f072 Mon Sep 17 00:00:00 2001
From: Vincent Vanackere <[email protected]>
Date: Wed, 26 Aug 2015 15:55:27 +0200
Subject: [PATCH 13/63] [release-branch.go1.5] cmd/go: properly ignore import
comments for vendored packages rooted at GOPATH
Fixes #12232.
Change-Id: Ide3fb7f5fc5ae377ae8683fbb94fd0dc01480549
Reviewed-on: https://go-review.googlesource.com/13924
Reviewed-by: Russ Cox <[email protected]>
Reviewed-on: https://go-review.googlesource.com/14228
Reviewed-by: Ian Lance Taylor <[email protected]>
---
src/cmd/go/pkg.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go
index 61e3d8d..c481794 100644
--- a/src/cmd/go/pkg.go
+++ b/src/cmd/go/pkg.go
@@ -368,7 +368,8 @@ func loadImport(path, srcDir string, parent *Package, stk *importStack, importPo
if gobin != "" {
bp.BinDir = gobin
}
- if err == nil && !isLocal && bp.ImportComment != "" && bp.ImportComment != path && (!go15VendorExperiment || !strings.Contains(path, "/vendor/")) {
+ if err == nil && !isLocal && bp.ImportComment != "" && bp.ImportComment != path &&
+ (!go15VendorExperiment || (!strings.Contains(path, "/vendor/") && !strings.HasPrefix(path, "vendor/"))) {
err = fmt.Errorf("code in directory %s expects import %q", bp.Dir, bp.ImportComment)
}
p.load(stk, bp, err)
--
2.6.1