summaryrefslogtreecommitdiff
path: root/src/cmd/api/goapi_test.go
diff options
context:
space:
mode:
authorMeng Zhuo <mengzhuo1203@gmail.com>2018-10-04 16:46:22 +0800
committerRobert Griesemer <gri@golang.org>2018-10-05 17:53:43 +0000
commit28fa1da9db8eedf079f1b83fd39383e17b3d7e68 (patch)
tree6824c561af5c9587714a99f71d82e7a49681ff37 /src/cmd/api/goapi_test.go
parent415e948eaea05930b2a16bab6af9e38b24e8414b (diff)
downloadgo-git-28fa1da9db8eedf079f1b83fd39383e17b3d7e68.tar.gz
cmd/api: explicit tagKey with GOOS and GOARCH
The origin tagKey is just dirname if no tags input which will cause pkgCache missmatch if other imported pkg explicit on GOARCH or GOOS This CL will add GOOS and GOARCH to tagKey Fixes #8425 Fixes #21181 Change-Id: Ifc189cf6746d753ad7c7e5bb60621297fc0a4e35 Reviewed-on: https://go-review.googlesource.com/c/138315 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/api/goapi_test.go')
-rw-r--r--src/cmd/api/goapi_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go
index 3c4e50a21a..1c8e2a345b 100644
--- a/src/cmd/api/goapi_test.go
+++ b/src/cmd/api/goapi_test.go
@@ -188,3 +188,18 @@ func BenchmarkAll(b *testing.B) {
}
}
}
+
+func TestIssue21181(t *testing.T) {
+ for _, c := range contexts {
+ c.Compiler = build.Default.Compiler
+ }
+ for _, context := range contexts {
+ w := NewWalker(context, "testdata/src/issue21181")
+ pkg, err := w.Import("p")
+ if err != nil {
+ t.Fatalf("%s: (%s-%s) %s %v", err, context.GOOS, context.GOARCH,
+ pkg.Name(), w.imported)
+ }
+ w.export(pkg)
+ }
+}