Go 1.14: Module support in the go command is production-ready
Every six months, a new Golang release arrives. Go 1.14 is here and it includes some changes to the language, as well as improved defer performance and a more efficient page allocator. With 1.14, module support in the Go command is now officially ready for use in production. Users are now strongly encouraged to migrate to go modules.
On February 25, 2020 the Go team released the latest version of the language with Golang 1.14. This release arrives right on time, six months after 1.13 and continues to maintain Go version 1 compatibility.
It includes changes in the implementation of the toolchain, runtime, and libraries as well as some changes to the language and performance upgrades.
👩🏽🔬️Go 1.14 is released!
📝 Release notes: https://t.co/17ydG0OGym
— Go (@golang) February 25, 2020
Production-ready module support in the go command
With this release, module support in the
go command is now ready for use in production.
In the 1.14 announcement blog, the Go team recommends that with this update, all users should migrate
go modules for dependency management. Read about how to migrate to Go modules in your projects here.
SEE ALSO: How Curve is getting ahead with Golang
In order to migrate, your project must either be a new Go project, an established project with a non-modules dependency manager, or an established project without any dependency manager. Users can report any issues during this process on GitHub.
Embedded overlapping interfaces
The language itself receives a change. From the release notes:
Per the overlapping interfaces proposal, Go 1.14 now permits embedding of interfaces with overlapping method sets: methods from an embedded interface may have the same names and identical signatures as methods already present in the (embedding) interface. This solves problems that typically (but not exclusively) occur with diamond-shaped embedding graphs. Explicitly declared methods in an interface must remain unique, as before.
1.14 improves the performance of
defer uses. Now, the overhead has been reduced to nearly zero and users can use
defer in their production-critical code without having to worry about performance.
In addition to this, goroutines are now asynchronously preemptible. Programs built with Golang 1.14 will receive more signals on Unix systems, including Linux and macOS systems, as compared to programs built with older releases.
Internal timers have been made more efficient, which should cause performance improvements without any visible changes. The page allocator also received an efficiency update.
Miscellaneous updates & improvements
Besides the aforementioned highlights, here are some additional changes that 1.14 makes:
- New package:
gocommand includes plain-text error message snippets
- Support for SSL version 3.0 removed
- For macOS binaries, Go symbols now all begin with an underscore
- New environmental variable:
- New default option:
-d=checkptras a compile-time option when adding instrumentation for checking to see if Go code is following
unsafe.Pointersafety rules. (Not currently recommended for Windows systems.)
- Upgraded Unicode 11.0 to Unicode 12.0
- Added support for 64-bit ARM on FreeBSD 12.0 or later
- Testing package supports cleanup functions
- Decoder type supports
View the full release notes for additional information on what Go 1.14 includes.
Upgrade to the latest release from the downloads page. Follow the instructions to get started and test out the newest features.
A new version of Golang is projected to release every six months. View the proposals for the next version, Go 1.15, scheduled for an August 2020 release. Go 1.15 will require macOS 10.12 Sierra or later.