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,
To do it, we have to build the binary from the source, and in this post I’ll guide you.
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.
So that’s it. For more details, check out this complete guide from the official doc:
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.