MCPcopy
hub / github.com/golang/tools / NeedsGoBuild

Function NeedsGoBuild

internal/testenv/testenv.go:276–283  ·  view source on GitHub ↗

NeedsGoBuild skips t if the current system can't build programs with “go build” and then run them with os.StartProcess or exec.Command. Android doesn't have the userspace go build needs to run, and js/wasm doesn't support running subprocesses.

(t testing.TB)

Source from the content-addressed store, hash-verified

274// Android doesn't have the userspace go build needs to run,
275// and js/wasm doesn't support running subprocesses.
276func NeedsGoBuild(t testing.TB) {
277 t.Helper()
278
279 // This logic was derived from internal/testing.HasGoBuild and
280 // may need to be updated as that function evolves.
281
282 NeedsTool(t, "go")
283}
284
285// NeedsDefaultImporter skips t if the test uses the default importer,
286// returned by [go/importer.Default].

Callers 15

TestBuildPackageGraphFunction · 0.92
TestHelpFilesFunction · 0.92
TestVerboseHelpFunction · 0.92
TestIssue56632Function · 0.92
testExternal_NotHandledFunction · 0.92
TestLoadOverlayGoModFunction · 0.92
TestIssue70394Function · 0.92
TestBuildPackageFunction · 0.92
TestRuntimeTypesFunction · 0.92
loadPackagesFunction · 0.92

Calls 1

NeedsToolFunction · 0.85

Tested by 15

TestBuildPackageGraphFunction · 0.74
TestHelpFilesFunction · 0.74
TestVerboseHelpFunction · 0.74
TestIssue56632Function · 0.74
testExternal_NotHandledFunction · 0.74
TestLoadOverlayGoModFunction · 0.74
TestIssue70394Function · 0.74
TestBuildPackageFunction · 0.74
TestRuntimeTypesFunction · 0.74
loadPackagesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…