This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: fix precedence logic between GOFLAGS and -tags (#76)
Thanks to Roger Peppe for picking this up in the last review.
- Loading branch information
Showing
2 changed files
with
53 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Test that we have correct precedence handling of GOFLAGS and -tags | ||
gobin -m -run . | ||
stdout '^Not blah$' | ||
gobin -m -run -tags blah . | ||
stdout '^Blah$' | ||
env GOFLAGS=-tags=blah | ||
gobin -m -run . | ||
stdout '^Blah$' | ||
gobin -m -run -tags '' . | ||
stdout '^Not blah$' | ||
|
||
-- go.mod -- | ||
module mod.com | ||
|
||
-- not_blah.go -- | ||
// +build !blah | ||
|
||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("Not blah") | ||
} | ||
-- blah.go -- | ||
// +build blah | ||
|
||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("Blah") | ||
} |