Google Go roadmap: What to expect in Versions 2 and 1.13

Major themes emerging for Go 2 include support for better error-handling and generics

Become An Insider

Sign up now and get FREE access to hundreds of Insider articles, guides, reviews, interviews, blogs, and other premium content. Learn more.

Builders of the Google Go language (Golang) are exploring directions for the language’s next generation. Major themes emerging for Go 2 include support for better error-handling and generics. While Go 1 was a small team effort, Go 2 will be more community-driven. Enhancements for Go 1.13 are also under consideration.

What’s planned for Go 2

Draft designs for these two areas have been published, although more exploration is needed. Error-handling in Go has had issues with too much error-checking boilerplate code and insufficient precise error reporting. The plan under consideration involves adding a check expression, to shorten error handling while keeping them explicit. A new handle statement defines what actions to take when a check fails, making it easier to add precise error reporting in a single place. Additional standard interfaces for error values also may be explored.

For generics, the goal is to address the problem with writing libraries that abstract away needless type detail by allowing parametric polymorphism with type parameters. Go’s builders want to make it possible to write useful libraries for manipulating arbitrary map and channel values and write polymorphic functions that can operate on both []byte and string values.

Proposals for Go 2 include suggestions for significant library or language changes, including some that do not meet the Go 1 compatibility guarantee. As of late November, there were 120 issues labeled as Go 2 proposals, ranging from generic programming facilities to having only one way of declaring variables. Some related proposals have been merged.

To continue reading this article register now