{
  "id": "go/build-constraint-conflict",
  "signature": "go: inconsistent build constraints: //go:build linux && !linux",
  "signature_zh": "go: 不一致的构建约束: //go:build linux && !linux",
  "regex": "go:\\ inconsistent\\ build\\ constraints:\\ //go:build\\ linux\\ \\&\\&\\ !linux",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "A file has contradictory build tags that cannot be simultaneously true, causing the file to be ignored or causing a build error.",
  "root_cause_type": "generic",
  "root_cause_zh": "文件包含矛盾的构建标签，无法同时为真，导致文件被忽略或构建错误。",
  "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": "Removing all build constraints from the file.",
      "why_fails": "The file will be built for all platforms, which may cause compilation errors on unsupported OS.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding more build constraints to override.",
      "why_fails": "More constraints can create further conflicts; the logic must be consistent.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Correct the build constraint to be logically consistent.",
      "success_rate": 0.95,
      "how": "Change '//go:build linux && !linux' to a valid constraint like '//go:build linux'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use separate files for different platforms with proper build tags.",
      "success_rate": 0.9,
      "how": "Create platform-specific files (e.g., file_linux.go, file_windows.go) with correct tags.",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}