Generics Type Parameters func Min[T constraints.Ordered](x, y T) T { func Min(x, y int) int { As opposed to the an equivalent (for ints) monomorphic version
Generics Bracket beats chevron package main import "fmt" import "golang.org/x/exp/constraints" func Min[T constraints.Ordered](x, y T) T { if x < y { return x } return y } func main() { fmt.Println(Min[int](2, 3)) fmt.Println(Min[float32](2.5, 2.6)) }
Generics Chevron cuts paper package main import "fmt" func Min(x, y int) int { if x < y { return x } return y } func main() { fmt.Println(Min(2, 3)) fmt.Println(Min(2.5, 2.6)) // Error! }
Fuzzing Get cover! Fuzzing is a type of automated testing which continuously manipulates inputs to a program to f ind bugs.
Good for f inding edge cases: it’s an extremely valuable feat whenever security is concerned, and still very valuable to hunt down hard-to- f ind bugs.
Workspace mode It ain’t much, but it’s honest go work • A new, optional go.work f ile has been introduced: if present, it will set Go in Workspace Mode.
• When in Workspace Mode, go will use the go.work f ile to determine all the modules to use as roots for module resolution, as opposed to having a single one as imposed by go.mod
• Such Mode allows for work on multiple, independent modules at the same time more conveniently than it was in the past
And moar! Faster and furiouser, sometimes • More ef f icient way to pass function argument on arm64 and some amd64, getting up to 10% performance improvements
• Due to generics, compile speed can get about 15% slower than go 1.17