What’s New in Go 1.20? Key Features, Performance Boosts, and OS Support

Go 1.20, released six months after 1.19, brings major toolchain, runtime, and library updates—including new slice‑to‑array conversion, unsafe package functions, struct field comparison rules, comparable type enhancements, reduced binary size, build‑flag architecture support, coverage flags, and experimental RISC‑V FreeBSD support—while improving CPU performance by up to 2% and cutting memory overhead.

21CTO
21CTO
21CTO
What’s New in Go 1.20? Key Features, Performance Boosts, and OS Support

Go 1.20 was officially released six months after Go 1.19, focusing most changes on the toolchain, runtime, and standard library implementation.

Download the new version at https://go.dev/dl/ .

Go 1.20 is the last version that runs on any Windows 7, 8, Server 2008, Server 2012, and on macOS 10.13 High Sierra or 10.14 Mojave; Go 1.21 will require Windows 10/Server 2016 and macOS 10.15 Catalina or newer. It also adds experimental support for RISC‑V on FreeBSD (GOOS=freebsd, GOARCH=riscv64).

Four syntax changes are introduced:

Extended slice‑to‑array conversion: a slice can be directly cast to an array, e.g., *(*[4]byte)(x).

The unsafe package now defines three new functions: SliceData, String, and StringData, enabling full construction and deconstruction of slices and strings without relying on their exact representation.

Struct variable comparison now proceeds field by field in declaration order, stopping at the first mismatched field.

Comparable types (including ordinary interfaces) now satisfy the comparable constraint even when the type argument is not strictly comparable.

Other notable updates include:

The $GOROOT/pkg directory no longer stores pre‑compiled standard packages, reducing distribution size.

The go command now defines architecture‑specific build flags (e.g., amd64.V2) to select implementations based on CPU features.

Build and install commands now support the -cover flag for code‑coverage instrumentation.

Memory overhead and CPU usage have been reduced by up to 2% thanks to garbage‑collector improvements.

Preview support for Profile Guided Optimizations (PGO).

On Linux, the linker now chooses the dynamic interpreter for glibc or musl at link time.

A new crypto/ecdh package provides explicit support for NIST curves and Curve25519 Elliptic Curve Diffie‑Hellman key exchange.

The Go team reports that compiler and garbage‑collector enhancements boost CPU performance by about 2% and cut memory usage, while build speed has increased roughly 10%, returning to Go 1.17 levels.

Future plans include moving the bootstrap toolchain forward each year, and Go 1.21 will drop support for older operating systems such as Windows 7/8, Server 2008/2012, and macOS 10.13/10.14.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendGolangprogrammingGoreleasego1.20
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.