{
  "id": 11678024,
  "title": "Go JSON v2 Migration: What Breaks in Go 1.27",
  "url": "https://urgent.news/2026/10/03/go-json-v2-migration-what-breaks-in-go-1-27",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-03T12:03:08.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://importstatic.com/go/go-json-v2-migration"
  },
  "original_language": "en",
  "account": "Go 1.27 introduced the encoding/json/v2 package in the standard library. Users may not notice this change as their output remains the same, but errors can differ and some behaviors have changed. Nil slices and maps are now marshaled as [] and {}, which is more compatible with JavaScript clients. OmitEmpty (omitempty) now omits fields only if they would encode as JSON null, empty, or {}. Case-insensitive field matching is removed, and duplicate keys are rejected unless explicitly allowed. Invalid UTF-8 is treated as an error in v2. Go 1.27.1, the current point release as of 2026-10-03, supports both the old and new implementations. To switch to the new implementation, upgrade to Go 1.27 and run tests. When migrating, pay attention to error messages, as they may differ. Most differences can be attributed to types, so the same struct encodes identically with either package. The new implementation also introduces options like json.RejectUnknownMembers(true) that are not available in the old version.",
  "summary": null,
  "key_points": [
    "Go 1.27 introduces encoding/json/v2 package in standard library",
    "Nil slices and maps marshaled as [] and {} for JavaScript compatibility",
    "Migration requires attention to error messages and options"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}