惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
Y
Y Combinator Blog
博客园 - Franky
D
Docker
B
Blog RSS Feed
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
B
Blog
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
Vercel News
Vercel News
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News

The Go Blog

Size-Specialized Memory Allocation - The Go Programming Language Goroutine Leak Profiles - The Go Programming Language Generic Methods - The Go Programming Language Introducing the pkg.go.dev API - The Go Programming Language Type Construction and Cycle Detection - The Go Programming Language //go:fix inline and the source-level inliner - The Go Programming Language Allocating on the Stack - The Go Programming Language Using go fix to modernize Go code - The Go Programming Language Go 1.26 is released - The Go Programming Language Results from the 2025 Go Developer Survey - The Go Programming Language Go’s Sweet 16 - The Go Programming Language The Green Tea Garbage Collector - The Go Programming Language Flight Recorder in Go 1.25 - The Go Programming Language It's survey time! How has Go has been working out for you? - The Go Programming Language
Go 1.27 is released - The Go Programming Language
Nicholas Husin, on behalf of the Go team 19 August 2026 · 2026-08-20 · via The Go Blog

The Go Blog

Today the Go team is pleased to release Go 1.27. You can find its binary archives and installers on the download page.

Go 1.27 brings major enhancements across the language, toolchain, runtime, and standard library. Below are some of the key highlights.

Language changes

Go 1.27 introduces three notable updates to the language specification.

First, generic methods are now supported. For example, see math/rand/v2.Rand:

// Prior to Go 1.27, a separate method on Rand had to be added for each type
// (unsigned integer methods omitted for brevity).
func (r *Rand) Int32N(n int32) int32
func (r *Rand) Int64N(n int64) int64
func (r *Rand) IntN(n int) int

// Go 1.27 adds a new generic method that works for all integer types.
func (r *Rand) N[Int intType](n Int) Int

Second, a key in a struct literal may now be any valid field selector for the struct type, allowing fields in nested or embedded structs to be initialized directly:

type Habitat struct {
    Burrow string
}

type Gopher struct {
    Name    string
    Habitat // Embedded struct.
}

// Go 1.27 allows using Burrow as a key directly.
g := Gopher{
    Name:   "Gopher",
    Burrow: "Burrow #42",
}

Finally, function type inference has been generalized to apply in all assignment contexts. Generic functions can now be used without explicit type arguments in composite literals, type conversions, and channel sends:

func GenericFormatter[T any](v T) string {
    return fmt.Sprintf("value: %v", v)
}

type IntFormatter func(int) string

// Go 1.27 infers T = int in composite literals, conversions, and channel sends.
formatters := []IntFormatter{GenericFormatter}
fn := IntFormatter(GenericFormatter)
ch := make(chan IntFormatter, 1)
ch <- GenericFormatter
  • go fix includes several new modernizers: atomictypes, embedlit, slicesbackward, and unsafefuncs.
  • go doc now supports package@version queries such as go doc example.com/pkg@v1.2.3.
  • go mod tidy now automatically consolidates multiple require blocks in go.mod into a standard direct and indirect two-block structure.

Performance and runtime

Standard library additions

Please read the Go 1.27 release notes for the complete list of changes and details.

Over the next few weeks, follow-up blog posts will cover some of the topics relevant to Go 1.27 in more detail. Check back later to read those posts.

Thanks to everyone who contributed to this release by writing code, filing bugs, trying out experimental additions, and testing release candidates. As always, if you notice any problems, please file an issue.

We hope you enjoy using Go 1.27!