{
  "id": "go/unsupported-scan-type",
  "signature": "sql: Scan error on column index 2: unsupported Scan, storing driver.Value type <nil> into type *time.Time",
  "signature_zh": "sql：列索引 2 上的 Scan 错误：不支持的 Scan，将 driver.Value 类型 <nil> 存储到 *time.Time 类型中",
  "regex": "unsupported Scan, storing driver.Value type <nil> into type \\*time\\.Time",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The database returned a NULL value for a column that is mapped to a non-pointer Go type like time.Time, which cannot represent nil.",
  "root_cause_type": "generic",
  "root_cause_zh": "数据库为映射到非指针 Go 类型（如 time.Time）的列返回了 NULL 值，该类型无法表示 nil。",
  "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": "Changing the column type in the database to NOT NULL.",
      "why_fails": "This may break existing data or require schema migration; also not always under developer control.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a default value in the SQL query with COALESCE.",
      "why_fails": "COALESCE changes the query result but may mask missing data; also requires modifying every query.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a pointer type for the Go field, e.g., *time.Time instead of time.Time, to allow nil values.",
      "success_rate": 0.95,
      "how": "Use a pointer type for the Go field, e.g., *time.Time instead of time.Time, to allow nil values.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use sql.NullTime type from the database/sql package to handle nullable timestamps.",
      "success_rate": 0.9,
      "how": "Use sql.NullTime type from the database/sql package to handle nullable timestamps.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use a pointer type for the Go field, e.g., *time.Time instead of time.Time, to allow nil values.",
    "Use sql.NullTime type from the database/sql package to handle nullable timestamps."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pkg.go.dev/database/sql#NullTime",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-11-08",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}