-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/stringer, go/loader: use testenv.NeedsTool(t, "cgo")
Using go env CGO_ENABLED has an advantage over build.Default.CgoEnabled in that it pays attention to whether a C compiler is available in $PATH, so it correctly skips the test when cgo is not enabled in more contexts. I haven't found better docs for this than https://go.dev/doc/go1.20#cgo. Also add this in TestCgoCwdIssue46877, since it requires cgo. Change-Id: Ib14a983cc179b725a98f154846662887a91edc19 Reviewed-on: https://go-review.googlesource.com/c/tools/+/560175 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
- Loading branch information
Showing
3 changed files
with
9 additions
and
7 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