1

On March 15, 2022 US time, the Go team officially announced the official release of Go 1.18!

According to the Go team: Go 1.18 is a release that includes a number of new features, including the biggest ever change to the language itself (generics), toolchain implementation, runtime and library changes, and performance improvements. It is no exaggeration to say that parts of Go 1.18 were conceived more than a decade ago when Go was first released.

Here's a quick preview of these latest features:

Generics

Go 1.18 introduced new support for generic code using parameterized types. Generics support is the most frequently requested feature in Go, and subsequent releases will continue to provide additional support for some more complex generic use cases.

Go encourages users to use the Generics tutorial to learn about this new feature and to explore the best ways to use generics to optimize and simplify your code.

Generics tutorial link: https://go.dev/doc/tutorial/generics

There are more details on using generics in the Go 1.18 release notes.

Fuzzing

With the release of Go 1.18, Go became the first major language to fully integrate fuzzing into its standard toolchain. Like generics, fuzzing has been designed for a long time.

Get started with this new feature in conjunction with the Fuzzing tutorial.

Fuzzing tutorial link: https://go.dev/doc/tutorial/fuzz

Workspaces

Go modules are now almost universally adopted, and users express very high levels of satisfaction in the annual Go survey. In the 2021 user survey, users reported that the most common challenge for Go modules was working across multiple modules.

In Go 1.18, this problem is solved by using the new Go workspace mode, which makes it simple to work in multiple modules.

Workspace tutorial link: https://go.dev/doc/tutorial/workspaces

20% performance boost

Apple M1, ARM64 and PowerPC64 users will be delighted! Go 1.18 sees up to 20% CPU performance improvement thanks to the extension of Go 1.17's register ABI calling convention to these architectures.

To underscore how big the performance improvement is with this release, Go even listed a 20% performance improvement as the fourth most important title!

For more details on Go 1.18, see: https://go.dev/doc/go1.18

Download link: https://go.dev/dl/


六一
556 声望347 粉丝

SegmentFault 新媒体运营