days
-1
-6
hours
-1
-4
minutes
0
-7
seconds
-1
-9
search
Go fetch the new update

Golang 1.13: Error wrapping, improved performance, new default proxy

Sarah Schlothauer
#go
golang
© Shutterstock / yhelfman

It’s time! Version 1.13 of Golang has arrived, with new language changes in tow and some performance improvements. This time around, changes include a more uniform and modernized set of number literal prefixes, improved modules support, error wrapping, TLS 1.3 on by default, and a few more tweaks.

Time to get up and Go. The newest version of Golang was released on September 3, 2019, just six months after Go 1.12. Welcome version 1.13! This version continues to maintain Go 1 version compatibility.

This release makes some changes to the language, including error wrapping, improved modules, and some language changes.

Golang 1.13 features

Let’s have a look at some highlights and new features.

golang

Go gopher designed by Renee French. Image under CC0 license.

Error wrapping

Support for error wrapping arrives, as per the Error Values proposal.

From the release notes:

An error e can wrap another error w by providing an Unwrap method that returns w. Both e and w are available to programs, allowing e to provide additional context to w or to reinterpret it while still allowing programs to make decisions based on w.

View the documentation and the FAQ for more information.

Number literal improvements

The new release makes number literal prefixes more uniform and modernized.

1.13 introduces improvements to: binary integer literals, octal integer literals, hexadecimal floating point literals, imaginary literals, and digit separators.

TLS 1.3 by default

According to Cloudfare, the TLS 1.3 protocol (Transporation Layer Security) enhances HTTPS performance and improves browser security and privacy. It includes a full handshake signature and downgrade protection.

Its default inclusion in Golang allows for improved page loading time.

Changes & optimizations

Some minor changes and performance optimizations include:

Full release notes available here.

New default proxy

The release is causing some controversy and discussion, however. Some opened issues on GitHub raise concerns regarding the new default proxy system that 1.13 introduces. With this release, by default Go uses a Google Privacy Policy owned proxy to fetch module dependencies.

SEE ALSO: The trendy five: Closing summer with our favorite August 2019 GitHub repos

Users can change this configuration.

According to the release notes:

As of Go 1.13, the go command by default downloads and authenticates modules using the Go module mirror and Go checksum database run by Google. See https://proxy.golang.org/privacy for privacy information about these services and the go command documentation for configuration details including how to disable the use of these servers or use different ones. If you depend on non-public modules, see the documentation for configuring your environment.

PHP and Go developer Jesse Donat opened up an issue on GitHub titled ‘cmd/go: permit marking a module as private in go.mod‘.

The new proxy system requires individual machines environmental variables to be set up for private modules. This means knowledge about the build that is not kept in the repo. This is not ideal.

Test it out!

Upgrade to the latest release from the download page.

Follow the installation instructions available here and get started with the new features.

Already looking forward to the next release? Golang verison 1.14 is due by February 1, 2020.

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of