Go 1.12 is a go for runtime improvements, module support, and more!
Spring is in the air and it’s time to check on our favorite Gopher! Go 1.12 is here; what does this update bring? Significant runtime improvements, more module support, some depreciated tools, and as always, backwards compatibility.
Go has been quite good about their regular update schedule. There’s a new release every six months, like clockwork. Go 1.12 promises a number of runtime performance improvements, minor tool depreciations, improved module support, and absolutely no language specification changes. As always, this release complies with Go’s fundamental promise of backwards compatibility.
Let’s dive right in and see what’s in store for developers!
Let’s start with the good stuff: Go 1.12 significantly improves runtime performance. This release reduces allocation latency immediately after garbage collection by sweeping when a large fraction of the heap remains live. For larger allocations that can’t reuse existing heap space, Go 1.12 releases memory back to the OS more aggressively.
The runtime timer and deadline code has been modified to scale nicely with more CPUs to improve network connection deadlines.
Memory-wise, the Go 1.12 release fixed the over counting of large heap allocations, improving the accuracy of memory profiles. For Linux, Go uses
MADV_FREE to release unused memory for efficiency’s sake. However, although this does occasionally result in a higher reported RSS, the kernel reclaims unused data when necessary.
Please note: Go 1.12 is the last release that will support binary-only packages. There are a few changes here, including a couple tools that have been depreciated.
Let’s go through the list!
go tool vetis no longer supported, since the
go vetcommand has been rewritten to serve as the base for a range of different source code analysis tools. More information is available here.
- The Go tour is no longer included in the main binary distribution.
- Build cache is now required, since Go plans to gradually eliminate the
godocno longer has a command-line interface and is only a web server. Users should use
go docfor command-line help output instead.
It’s been six months since the Go modules finally landed. There are a few changes here as well. When the
GO111MODULE is activated, the
go command supports module-aware operations outside of a module directory. Commands such as
go list, and
go mod download behave as if in a module. Also, go commands that download and extract modules are safe to invoke concurrently.
As for the compiler toolchain, the compiler’s live variable analysis has improved. As a result, finalizers can be executed sooner than in older releases. More functions are eligible for inlining by default. Be careful and use
runtime.CallersFrames instead of iterating over the result of
Additionally, the compiler now accepts a
-lang flag to set the Go language version to use. This release also uses different conventions to call Go functions and assembly functions, although this should be invisible to users.
Core library changes
Minor changes and updates here, mostly with backwards compatibility in mind. Check out the full list for all the details of what’s in and what’s out.
The Go 1.12 release adds opt-in support for TLS 1.3. All the TLS 1.2 features are available in TLS 1.3, except now there is better security and performance metrics. Take a look at all the changes here!
Getting Go 1.12
Want to upgrade? We don’t blame you; Golang is a very useful language to know and use.