{
  "id": "go/go-mod-tidy-ambiguous-import",
  "signature": "go: ambiguous import: found package X in multiple modules: github.com/foo/bar and github.com/baz/bar",
  "signature_zh": "go: 歧义导入：在多个模块中发现包 X：github.com/foo/bar 和 github.com/baz/bar",
  "regex": "go: ambiguous import: found package .+ in multiple modules:",
  "domain": "go",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "Two different modules provide the same import path, causing ambiguity in the module resolution.",
  "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Running go mod tidy repeatedly hoping it resolves",
      "why_fails": "go mod tidy cannot resolve ambiguity; it requires manual intervention to specify which module to use.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Deleting go.sum and re-running go mod download",
      "why_fails": "Deleting go.sum doesn't fix the import path conflict; it only removes checksums.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a replace directive in go.mod to force one module: replace github.com/foo/bar => github.com/foo/bar v1.2.3",
      "success_rate": 0.9,
      "how": "Use a replace directive in go.mod to force one module: replace github.com/foo/bar => github.com/foo/bar v1.2.3",
      "condition": "",
      "sources": []
    },
    {
      "action": "Rename one of the conflicting packages or use a different import path by vendoring.",
      "success_rate": 0.75,
      "how": "Rename one of the conflicting packages or use a different import path by vendoring.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 go.mod 中使用 replace 指令强制指定一个模块：replace github.com/foo/bar => github.com/foo/bar v1.2.3",
    "重命名冲突的包之一，或通过 vendor 使用不同的导入路径。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://go.dev/ref/mod#go-mod-file-require",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2024-05-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}