{
  "id": "go/flag-requires-an-argument",
  "signature": "flag needs an argument: -v",
  "signature_zh": "标志需要参数：-v",
  "regex": "flag needs an argument: -[a-zA-Z]",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "A command-line flag that requires an argument was provided without one, causing the flag package to abort.",
  "root_cause_type": "generic",
  "root_cause_zh": "提供了需要参数的命令行标志但未提供参数，导致 flag 包中止。",
  "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": "Removing the flag entirely from the command line.",
      "why_fails": "The flag may be required for the program to function correctly; removing it could lead to different errors.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a double dash (--) before the flag to stop option parsing.",
      "why_fails": "The double dash only stops parsing of subsequent arguments; it does not provide the missing argument.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Provide the required argument immediately after the flag, either as the next word or with an equals sign, e.g., -v=3 or -v 3.",
      "success_rate": 0.95,
      "how": "Provide the required argument immediately after the flag, either as the next word or with an equals sign, e.g., -v=3 or -v 3.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the flag definition in the source code to confirm if the flag expects an argument (e.g., using flag.IntVar vs flag.BoolVar).",
      "success_rate": 0.8,
      "how": "Check the flag definition in the source code to confirm if the flag expects an argument (e.g., using flag.IntVar vs flag.BoolVar).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Provide the required argument immediately after the flag, either as the next word or with an equals sign, e.g., -v=3 or -v 3.",
    "Check the flag definition in the source code to confirm if the flag expects an argument (e.g., using flag.IntVar vs flag.BoolVar)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pkg.go.dev/flag",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-03-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}