The Go programming language released version 1.20 a few days ago. See what’s the new features!
Go 1.20 allows conversions from a slice to an array. Given a slice x, user can write
byte(x) instead of
The unsafe package now has three new functions
StringData with complete ability to construct and deconstruct slice and string values, without depending on their exact representation.
The specification now defines that struct values are compared one field at a time. Similarly, the specification now defines that array values are compared one element at a time.
And, comparable types (such as ordinary interfaces) may now satisfy comparable constraints, even if the type arguments are not strictly comparable.
Go 1.20 also adds experimental support for FreeBSD on RISC-V. Also, this is the last release that supports for Windows 7, Windows 8, Server 2008 and Server 2012, macOS 10.13 High Sierra and 10.14 Mojave.
Other changes in Go 1.20 include:
- The directory
$GOROOT/pkgno longer stores pre-compiled package archives for the standard library. Instead, they are built as needed and cached in the build cache.
-C <dir>to navigate directory before performing go sub-command.
-iflag support in
go version -mcommand supports reading more types of Go binaries
go install, and other build-related commands.
- Disable cgo by default on systems without a C toolchain
- Support collecting code coverage profiles for programs by building with go build’s
- The vet tool reports ISO 8601 date (yyyy-dd-mm) time format with
- Reorganize garbage collector’s internal data structures to improve overall CPU performance by up to 2%.
- New runtime/coverage package containing APIs
- Preview support for profile-guided optimization (PGO)
- Select the dynamic interpreter for glibc or musl at link time on Linux.
- Go linker supports modern LLVM-based C toolchains in Windows.
crypto/ecdhpackage to provide explicit support
- New function
errors.Joinreturns an error wrapping a list of errors.
- The httputil.ReverseProxy forwarding proxy includes a new Rewrite hook function.
- Many other minor library changes.
For more about the Go 1.20 release, see the official release note.
Get Go 1.20
Go website offers the binary packages for macOS, Linux, and Windows. Along with the source tarball, they are available to download at the link below:
For Ubuntu and Debian based systems, I’ve a step by step tutorial shows how to install Go language and setup the environment, see HERE for details.