Trying Go Development Version

Photo by Cookie the Pom on Unsplash

In the upcoming v1.17 release, we will get one interesting feature in Go programming language, it’s the introduction of Generics API.

Generic is currently under heavy development by the Go teams. Several progresses have been merged into their Github master branch.

In case you are not too patient to wait for the release, you can actually try it now by using the development version of Go, compiled from the current development branch, master.

To do it, we have to build the binary from the source, and in this post I’ll guide you.

Preparation

Not much, just ensure you have a computer. I’ll recommend having a Linux or Mac, however I’m writing this tutorial using Centos OS.

Other than that, there will be some dependencies that we need to install, such as g++ compiler, go 1.4 toolchain, and others.

We are going to use the development version of Go, then why need go v1.14?
It’s because the toolchain to build Go from source code is actually built by using Go. The toolchain is available on go v1.14.

… But don’t worry, I’ve prepared a gist contains the full commands to perform the complete build from the beginning.

Installation

So that’s it. For more details, check out this complete guide from the official doc:

Installing Go from source - https://golang.org/doc/install/source

Too busy to do the stuff

As the subtitle says, if you are bored or too busy doing the steps, but still want to taste the development version of Go, here is the solution.

You can reuse this docker image. I’ve prepared the image on Docker Hub.

I make humanity better through my inventions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store