Quellcode als Symbol fuer die Programmiersprache Go

Go 1.27: Generic Methods and a New JSON Package

Six months after Go 1.26, the Go team has released version 1.27. The language finally gains generic methods, and the JSON package gets a thoroughly reworked v2 version.

Generic methods

Methods may now declare their own type parameters – a long-awaited addition. This allows generic functions to live directly within the namespace of a data type. Example: math/rand/v2 now offers a generic method (*Rand).N instead of just a package function.

encoding/json/v2

The encoding/json/v2 package is a major revision of JSON handling, with new Marshal and Unmarshal variants and configurable Options arguments. The defaults are stricter and more interoperable: invalid UTF-8 in strings and duplicate names within a JSON object are now rejected. There are also more SIMD functions and struct improvements.


Sources: Go Blog, Phoronix.

Mastodon
Scroll to Top