Go 1.25 introduces experimental encoding/json/v2 and encoding/json/jsontext packages to address long-standing issues in the original encoding/json package. The new v2 API fixes behavioral flaws like invalid UTF-8 handling and duplicate JSON keys, improves performance especially for unmarshaling (up to 10x faster), and provides better streaming capabilities. The jsontext package handles JSON syntax while v2 manages semantics, offering new interfaces like MarshalerTo and UnmarshalerFrom for better performance. The original v1 package will be reimplemented using v2 under the hood, allowing gradual migration while maintaining backward compatibility.
Sort: