{
  "id": "go/embed-directive-file-not-found",
  "signature": "pattern embed.go: no matching files found",
  "signature_zh": "模式 embed.go：未找到匹配的文件",
  "regex": "pattern .+: no matching files found",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The //go:embed directive specifies a file or pattern that does not exist relative to the source file's directory, or the file is excluded by .gitignore or build constraints.",
  "root_cause_type": "generic",
  "root_cause_zh": "//go:embed 指令指定的文件或模式相对于源文件目录不存在，或者该文件被 .gitignore 或构建约束排除。",
  "versions": [
    {
      "version": "Go 1.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go 1.17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go 1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go 1.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go 1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go 1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go 1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Go embed only supports relative paths (to the source file's directory); absolute paths are not allowed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Gitignore does not affect Go's embed; the file must exist on disk at build time.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the file exists relative to the source file; use a glob pattern like \"static/*\" to embed a directory",
      "success_rate": 0.95,
      "how": "Verify the file exists relative to the source file; use a glob pattern like \"static/*\" to embed a directory",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the file is generated, ensure it is generated before the build (e.g., using go generate)",
      "success_rate": 0.85,
      "how": "If the file is generated, ensure it is generated before the build (e.g., using go generate)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确认文件相对于源文件存在；使用通配符如 \"static/*\" 来嵌入目录",
    "如果文件是生成的，确保在构建前生成（例如，使用 go generate）"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pkg.go.dev/embed",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-08-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}