{
  "id": "go/missing-function-body",
  "signature": "missing function body",
  "signature_zh": "缺少函数体",
  "regex": "missing function body",
  "domain": "go",
  "category": "compile_error",
  "subcategory": null,
  "root_cause": "A function declaration has no body because the source file was truncated, the function is defined in another file not compiled, or a build tag caused the body to be excluded.",
  "root_cause_type": "generic",
  "root_cause_zh": "函数声明没有函数体，因为源文件被截断、函数定义在另一个未编译的文件中，或者构建标签导致函数体被排除。",
  "versions": [
    {
      "version": "go1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "go1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "go1.23",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The compiler requires an actual block {} not just a return; the function must have a body.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If the function is called elsewhere, removing it causes undefined errors.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Provide the missing function body: define the function with a block, e.g., `func foo() int { return 0 }`.",
      "success_rate": 0.95,
      "how": "Provide the missing function body: define the function with a block, e.g., `func foo() int { return 0 }`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using build tags, ensure the file with the function body is included: `go build -tags \"mytag\" .` or remove conflicting tags.",
      "success_rate": 0.9,
      "how": "If using build tags, ensure the file with the function body is included: `go build -tags \"mytag\" .` or remove conflicting tags.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Provide the missing function body: define the function with a block, e.g., `func foo() int { return 0 }`.",
    "If using build tags, ensure the file with the function body is included: `go build -tags \"mytag\" .` or remove conflicting tags."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://go.dev/ref/spec#Function_declarations",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2024-01-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}