{
  "id": "go/missing-go-mod-file",
  "signature": "go: cannot find main module; see 'go help modules'\n\tcurrent directory is outside of any module\n\tno go.mod file found in /home/user/project or any parent directory",
  "signature_zh": "go: 找不到主模块；请参阅 'go help modules'\n\t当前目录在任何模块之外\n\t在 /home/user/project 或任何父目录中未找到 go.mod 文件",
  "regex": "go:\\ cannot\\ find\\ main\\ module;\\ see\\ 'go\\ help\\ modules'\\\n\\\tcurrent\\ directory\\ is\\ outside\\ of\\ any\\ module\\\n\\\tno\\ go\\.mod\\ file\\ found\\ in\\ /home/user/project\\ or\\ any\\ parent\\ directory",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The current working directory does not contain a go.mod file, and no parent directory has one, so Go cannot determine the module context.",
  "root_cause_type": "generic",
  "root_cause_zh": "当前工作目录不包含 go.mod 文件，且任何父目录都没有，因此 Go 无法确定模块上下文。",
  "versions": [
    {
      "version": "1.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.20",
      "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"
    },
    {
      "version": "1.23",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Creating a go.mod file with arbitrary content",
      "why_fails": "The module path must be correct; arbitrary content may cause import resolution failures.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting GO111MODULE=off to use GOPATH mode",
      "why_fails": "If the project is not in GOPATH, it still fails; also disables modern module features.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Initialize the module with 'go mod init'",
      "success_rate": 0.95,
      "how": "go mod init example.com/project",
      "condition": "",
      "sources": []
    },
    {
      "action": "Navigate to a directory that contains a go.mod file",
      "success_rate": 0.9,
      "how": "cd /path/to/valid/module && go build",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-01-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}