• The Go Blog A new experimental Go API for JSON Introduction JavaScript Object Notation (JSON) is a simple data interchange format. • Almost 15 years ago, we wrote about support for JSON in Go, which introduced the ability to serialize and deserialize Go types to and from JSON data. • Since then, JSON has become the most popular data format used on the Internet. • It is widely read and written by Go programs, and encoding/json now ranks as the 5th most imported Go package. • Over time, packages evolve with the needs of their users, and encoding/json is no exception. • This blog post is about Go 1.25’s new experimental encoding/json/v2 and encoding/json/jsontext packages, which bring long-awaited improvements and fixes.
Article Summaries:
- The Go Blog announces Go 1.25’s experimental JSON packages, encoding/json/v2 and encoding/json/jsontext, which introduce a new major API version to replace the long‑used encoding/json. The update addresses long‑standing behavioral flaws: stricter UTF‑8 validation, rejection of duplicate object keys, safer handling of nil slices/maps, and case‑sensitive field matching. It also resolves inconsistencies in method invocation and improves performance. The packages are not yet part of the standard library and may change, but they provide early access to the improvements that users have requested for years.
Sources: