{"slug": "go-1-27-brings-support-for-generic-methods", "title": "Go 1.27 brings support for generic methods", "summary": "Google released Go 1.27 on August 19, adding support for generic methods, allowing method declarations to define their own type parameters, and enabling struct literal keys to be any valid field selector for nested or embedded fields. The update also improves function type inference in assignment contexts and includes toolchain enhancements such as new go fix rules, go doc package@version queries, and a goroutineleak analyzer in runtime/pprof.", "body_md": "Google’s [Go programming language](https://www.infoworld.com/article/2253031/whats-the-go-language-really-good-for-3.html) has been updated with changes across the language, toolchain, runtime, and standard library.\n\nReleased August 19, [Go 1.27](https://go.dev/blog/go1.27) brings three notable enhancements to the language specification, the Go team said. First, Go now supports [generic methods](https://go.dev/issue/77273), in which a [method declaration](https://go.dev/ref/spec#Method_declarations) may declare its own [type parameters](https://go.dev/ref/spec#Type_parameter_declarations). Second, a key in a [struct literal](https://go.dev/ref/spec#Composite_literals) may now be any valid [field selector](https://go.dev/ref/spec#Selectors) for the struct type, allowing fields in nested or embedded structs to be initialized directly. Third, function type inference now applies in all assignment contexts. This means generic functions now can be used without explicit type arguments in composite literals, type conversions, and channel sends.\n\nOther improvements in Go 1.27 include:\n\n`go fix`\n\n`atomictypes`\n\n, `embedlit`\n\n, `slicesbackward`\n\n, and `unsafefuncs`\n\n.`go doc`\n\n`package@version`\n\nqueries such as `go doc example.com/pkg@v1.2.3`\n\n.`go mod tidy`\n\n`require`\n\nblocks in `go.mod`\n\ninto a standard direct and indirect two-block structure.`goroutineleak`\n\n`runtime/pprof`\n\nAn [August 26 post](https://go.dev/blog/generic-methods) on the [Go blog](https://go.dev/blog/) provides more detail on Go’s new support for generic methods. The Go team said it would cover other Go 1.27 features in additional blog posts in the coming weeks.", "url": "https://wpnews.pro/news/go-1-27-brings-support-for-generic-methods", "canonical_source": "https://www.infoworld.com/article/4214999/go-1-27-brings-support-for-generic-methods.html", "published_at": "2026-08-27 19:19:45+00:00", "updated_at": "2026-08-27 19:51:50.450759+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Google", "Go", "Go 1.27"], "alternates": {"html": "https://wpnews.pro/news/go-1-27-brings-support-for-generic-methods", "markdown": "https://wpnews.pro/news/go-1-27-brings-support-for-generic-methods.md", "text": "https://wpnews.pro/news/go-1-27-brings-support-for-generic-methods.txt", "jsonld": "https://wpnews.pro/news/go-1-27-brings-support-for-generic-methods.jsonld"}}