-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go/internal/imports: recognize "unix" build tag
- Loading branch information
Showing
4 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Regression test for https://go.dev/issue/54712: the "unix" build constraint | ||
# was not applied consistently during package loading. | ||
|
||
go list -x -f '{{if .Module}}{{.ImportPath}}{{end}}' -deps . | ||
stdout 'example.com/version' | ||
|
||
-- go.mod -- | ||
module example | ||
|
||
go 1.19 | ||
|
||
require example.com/version v1.1.0 | ||
-- go.sum -- | ||
example.com/version v1.1.0 h1:VdPnGmIF1NJrntStkxGrF3L/OfhaL567VzCjncGUgtM= | ||
example.com/version v1.1.0/go.mod h1:S7K9BnT4o5wT4PCczXPfWVzpjD4ud4e7AJMQJEgiu2Q= | ||
-- main_notunix.go -- | ||
//go:build !(aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris) | ||
|
||
package main | ||
|
||
import _ "example.com/version" | ||
|
||
func main() {} | ||
|
||
-- main_unix.go -- | ||
//go:build unix | ||
|
||
package main | ||
|
||
import _ "example.com/version" | ||
|
||
func main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters