]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/imports: match solaris files for illumos
authorTobias Klauser <tklauser@distanz.ch>
Sat, 1 Jun 2019 22:51:46 +0000 (00:51 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 20 Jun 2019 17:47:10 +0000 (17:47 +0000)
Like the android/linux pair, match files with GOOS=solaris if
GOOS=illumos

Follow-up for CL 174457

Fixes #32370
Updates #20603

Change-Id: Id01de8bb3990d7bbb22f735a4abed2b3cf8b4062
Reviewed-on: https://go-review.googlesource.com/c/go/+/179997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/imports/build.go
src/cmd/go/internal/imports/testdata/illumos/a_illumos.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/b_illumos_amd64.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/c_solaris.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/d_solaris_amd64.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/e.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/f.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/g.go [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/tags.txt [new file with mode: 0644]
src/cmd/go/internal/imports/testdata/illumos/want.txt [new file with mode: 0644]

index 1e44a83c72a1b72e62bfa67539aa9df23def7a2c..3e9fe357e0792b7dc03ded1a6d93265d80b4c5cb 100644 (file)
@@ -138,6 +138,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
        if name == "linux" {
                have = have || tags["android"]
        }
+       if name == "solaris" {
+               have = have || tags["illumos"]
+       }
        return have == want
 }
 
@@ -152,7 +155,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
 //     name_$(GOARCH)_test.*
 //     name_$(GOOS)_$(GOARCH)_test.*
 //
-// An exception: if GOOS=android, then files with GOOS=linux are also matched.
+// Exceptions:
+//     if GOOS=android, then files with GOOS=linux are also matched.
+//     if GOOS=illumos, then files with GOOS=solaris are also matched.
 //
 // If tags["*"] is true, then MatchFile will consider all possible
 // GOOS and GOARCH to be available and will consequently
diff --git a/src/cmd/go/internal/imports/testdata/illumos/a_illumos.go b/src/cmd/go/internal/imports/testdata/illumos/a_illumos.go
new file mode 100644 (file)
index 0000000..2e6cb50
--- /dev/null
@@ -0,0 +1,3 @@
+package illumos
+
+import _ "a"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/b_illumos_amd64.go b/src/cmd/go/internal/imports/testdata/illumos/b_illumos_amd64.go
new file mode 100644 (file)
index 0000000..2834d80
--- /dev/null
@@ -0,0 +1,3 @@
+package illumos
+
+import _ "b"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/c_solaris.go b/src/cmd/go/internal/imports/testdata/illumos/c_solaris.go
new file mode 100644 (file)
index 0000000..d7f9462
--- /dev/null
@@ -0,0 +1,3 @@
+package illumos
+
+import _ "c"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/d_solaris_amd64.go b/src/cmd/go/internal/imports/testdata/illumos/d_solaris_amd64.go
new file mode 100644 (file)
index 0000000..0f52c2b
--- /dev/null
@@ -0,0 +1,3 @@
+package illumos
+
+import _ "d"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/e.go b/src/cmd/go/internal/imports/testdata/illumos/e.go
new file mode 100644 (file)
index 0000000..5e1ed3c
--- /dev/null
@@ -0,0 +1,5 @@
+// +build illumos
+
+package illumos
+
+import _ "e"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/f.go b/src/cmd/go/internal/imports/testdata/illumos/f.go
new file mode 100644 (file)
index 0000000..f3e3f72
--- /dev/null
@@ -0,0 +1,5 @@
+// +build solaris
+
+package illumos
+
+import _ "f"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/g.go b/src/cmd/go/internal/imports/testdata/illumos/g.go
new file mode 100644 (file)
index 0000000..b30f1eb
--- /dev/null
@@ -0,0 +1,5 @@
+// +build !illumos
+
+package illumos
+
+import _ "g"
diff --git a/src/cmd/go/internal/imports/testdata/illumos/tags.txt b/src/cmd/go/internal/imports/testdata/illumos/tags.txt
new file mode 100644 (file)
index 0000000..b6386a3
--- /dev/null
@@ -0,0 +1 @@
+illumos amd64
diff --git a/src/cmd/go/internal/imports/testdata/illumos/want.txt b/src/cmd/go/internal/imports/testdata/illumos/want.txt
new file mode 100644 (file)
index 0000000..0fdf397
--- /dev/null
@@ -0,0 +1,6 @@
+a
+b
+c
+d
+e
+f