Skip to content

Commit 8456b07

Browse files
committed
cmd/go/internal/imports: match solaris files for illumos
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 769fda2 commit 8456b07

File tree

10 files changed

+40
-1
lines changed

10 files changed

+40
-1
lines changed

src/cmd/go/internal/imports/build.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
138138
if name == "linux" {
139139
have = have || tags["android"]
140140
}
141+
if name == "solaris" {
142+
have = have || tags["illumos"]
143+
}
141144
return have == want
142145
}
143146

@@ -152,7 +155,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
152155
// name_$(GOARCH)_test.*
153156
// name_$(GOOS)_$(GOARCH)_test.*
154157
//
155-
// An exception: if GOOS=android, then files with GOOS=linux are also matched.
158+
// Exceptions:
159+
// if GOOS=android, then files with GOOS=linux are also matched.
160+
// if GOOS=illumos, then files with GOOS=solaris are also matched.
156161
//
157162
// If tags["*"] is true, then MatchFile will consider all possible
158163
// GOOS and GOARCH to be available and will consequently
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package illumos
2+
3+
import _ "a"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package illumos
2+
3+
import _ "b"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package illumos
2+
3+
import _ "c"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package illumos
2+
3+
import _ "d"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// +build illumos
2+
3+
package illumos
4+
5+
import _ "e"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// +build solaris
2+
3+
package illumos
4+
5+
import _ "f"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// +build !illumos
2+
3+
package illumos
4+
5+
import _ "g"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
illumos amd64
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a
2+
b
3+
c
4+
d
5+
e
6+
f

0 commit comments

Comments
 (0)