{"uid":"cap_6GJb2tMP2j_GyYvALHyo8","slug":"go-explicit-target-build-tag-filename-source-selection-f87917e8","name":"Go Explicit Target Build-Tag Filename Source Selection","description":"Reconstruct which Go source files belong to an explicit target and build-tag environment.","url":"https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-06/go-explicit-target-build-tag-filename-source-selection?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"artifact":{"type":"object","required":["goBuildSelection"],"properties":{"goBuildSelection":{"type":"object","required":["data","claim"],"properties":{"data":{"type":"object","required":["context","files","include_tests"],"properties":{"files":{"type":"array","items":{"type":"object","required":["name","expression"],"properties":{"name":{"type":"string","maxLength":128,"minLength":1},"expression":{"anyOf":[{"type":"null"},{"type":"string","maxLength":1024,"minLength":1}]}},"additionalProperties":false},"maxItems":64,"minItems":1},"context":{"type":"object","required":["goos","goarch","compiler","cgo","release_minor","tool_tags","tags"],"properties":{"cgo":{"type":"boolean"},"goos":{"type":"string","pattern":"^[A-Za-z0-9_.]+$","maxLength":64,"minLength":1},"tags":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_.]+$","maxLength":64,"minLength":1},"maxItems":32,"minItems":0},"goarch":{"type":"string","pattern":"^[A-Za-z0-9_.]+$","maxLength":64,"minLength":1},"compiler":{"enum":["gc","gccgo"]},"tool_tags":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_.]+$","maxLength":64,"minLength":1},"maxItems":32,"minItems":0},"release_minor":{"type":"integer","maximum":30,"minimum":1}},"additionalProperties":false},"include_tests":{"type":"boolean"}},"additionalProperties":false},"claim":{"anyOf":[{"type":"null"},{"type":"object","required":["selected","excluded","effective_tags"],"properties":{"excluded":{"type":"array","items":{"type":"object","required":["name","reason"],"properties":{"name":{"type":"string","maxLength":128,"minLength":1},"reason":{"enum":["hidden_name","not_go_source","test_file","filename_target","build_expression"]}},"additionalProperties":false},"maxItems":64,"minItems":0},"selected":{"type":"array","items":{"type":"string","maxLength":128,"minLength":1},"maxItems":64,"minItems":0},"effective_tags":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_.]+$","maxLength":64,"minLength":1},"maxItems":128,"minItems":0}},"additionalProperties":false}]}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_uarpORC-8HiGi8B-kN_wa","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Determines which Go source files are selected or excluded for a given build target and build-tag environment, reconstructing the Go toolchain's filename-based and expression-based file selection logic.","exampleAgentPrompt":"I have these Go source files — main.go, main_linux.go, main_windows.go, util_test.go, and compat_cgo.go — and I want to know which ones will actually be compiled when targeting linux/amd64 with the gc compiler, CGO enabled, Go 1.21, no extra tool tags, and the tags 'integration' and 'prod'. Don't include test files.","exampleUseCases":[{"title":"Cross-platform build file audit","prompt":"We have a Go package with files named like handler_linux.go, handler_darwin.go, handler_windows_amd64.go, and handler.go. Tell me which ones will be selected when building for darwin/arm64 with the gc compiler, CGO disabled, Go 1.20, no extra tags or tool tags, and test files excluded."},{"title":"CI build tag validation","prompt":"Before our CI pipeline runs, I need to verify which Go source files are picked up with the build tags 'integration' and 'ci' on linux/amd64, using the gc compiler, CGO enabled, Go 1.22, no tool tags, and including test files."},{"title":"Debugging unexpected file exclusions","prompt":"Some of our Go files seem to be getting dropped during builds and I can't figure out why. Here's the file list: config.go, config_cgo.go, config_nocgo.go, config_test.go. Can you reconstruct which ones are selected for linux/386 with the gc compiler, CGO disabled, Go 1.19, no tool tags, no extra build tags, excluding test files, and tell me the reason each excluded file was dropped?"}],"resultDescription":"Returns a structured result containing the list of selected Go source file names, a list of excluded files each annotated with a reason (hidden_name, not_go_source, test_file, filename_target, or build_expression), and the effective set of build tags that applied during the evaluation.","failureModes":["Invalid or missing required fields (goos, goarch, compiler, files) result in validation errors","File name or build tag expression exceeding length limits cause rejection","More than 64 files or 32 tags submitted triggers schema validation failure","Invalid compiler value (not 'gc' or 'gccgo') causes enum validation error","Malformed build tag expression strings may result in computation errors or unexpected exclusions"],"whenToPreferThis":"Use this endpoint when you need to programmatically simulate or verify the Go toolchain's file selection logic without running the actual Go compiler, especially for CI validation, build auditing, cross-platform analysis, or debugging unexpected file inclusion/exclusion. It is ideal when you have a list of filenames and a target environment and need to know exactly which files would be compiled and why others would be excluded.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T00:38:06.120Z","isFirstParty":false,"canonicalSlug":"go-explicit-target-build-tag-filename-source-selection-f87917e8"}