Member-only story
Golang 1.18: What You Need To Know
There are two major things coming in Go 1.18 that you need to know: Type Parameters (generics) and Fuzz Testing, but why are they so important?
The Golang team is hard at work on Golang 1.18, which will be released in February 2022, and it looks like it’s going to be a big one. Golang 1.18 will introduce generics (called type parameters) as well as fuzzy testing, which has the potential to change how we develop and test Golang programs for good! We’ll take a look at both of these new features below.
Type Parameters (aka Generics)
Type parameters (also known as generics in other languages) will allow Go programmers to define functions and methods with a placeholder type name. This will allow developers to write code that can be reused throughout different parts of the project but still work generically for all the types of data they expect it to support.
Let’s take a look at a normal Go function (before 1.18), which returns the lowest number of two inputs: