# Go Explicit Target Build-Tag Filename Source Selection

> Go Explicit Target Build-Tag Filename Source Selection is a paid API for AI agents from detect.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-17).

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.

## Facts

- Endpoint: POST https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-06/go-explicit-target-build-tag-filename-source-selection?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/go-explicit-target-build-tag-filename-source-selection-f87917e8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6GJb2tMP2j_GyYvALHyo8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability go-explicit-target-build-tag-filename-source-selection-f87917e8 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Reconstruct which Go source files belong to an explicit target and build-tag environment.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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",
           "ma
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/go-explicit-target-build-tag-filename-source-selection-f87917e8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from detect.halowerk.com](https://www.zero.xyz/host/detect.halowerk.com/llms.txt)
