{
  "id": "go/dependency-not-found-in-workspace",
  "signature": "go: module github.com/example/mod: not found in workspace",
  "signature_zh": "go: 在工作区中未找到模块",
  "regex": "go:\\ module\\ github\\.com/example/mod:\\ not\\ found\\ in\\ workspace",
  "domain": "go",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "When using Go workspaces (go.work), a required module is not listed in the workspace's go.work file.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用 Go 工作区 (go.work) 时，必需模块未列在工作区的 go.work 文件中。",
  "versions": [
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding the module path to go.mod instead of go.work.",
      "why_fails": "go.work is separate from go.mod; the workspace must include the module.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing go.work and running without workspace.",
      "why_fails": "This may break other modules that depend on the workspace structure.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the module to the workspace's go.work file.",
      "success_rate": 0.95,
      "how": "Run 'go work use ./path/to/module' to include the module in the workspace.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Initialize a new workspace with all modules.",
      "success_rate": 0.9,
      "how": "Run 'go work init' followed by 'go work use ./module1 ./module2' to add all modules.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-05-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}