DRAFT RELEASE NOTES — Introduction to Go 1.20

Go 1.20 is not yet released. These are work-in-progress release notes. Go 1.20 is expected to be released in February 2023.

Changes to the language

TODO: complete this section

Ports

TODO: complete this section, or delete if not needed

Tools

Go command

TODO: https://go.dev/cl/421440: cmd/go: add go generate -skip flag

TODO: https://go.dev/issue/45454: provide build tags for architecture environment variables

The Go distribution no longer ships with pre-compiled .a files for most of the packages in GOROOT, now only including .a files for the five packages in GOROOT that use cgo. Instead, those packages will be built as needed and cached in the build cache, as is already done for non-main packages outside GOROOT. Further, go install will also not install .a files for GOROOT packages except for those that use cgo. These changes are intended to reduce the size of the Go distribution, in some cases by up to two-thirds.

When the main module is located within GOPATH/src, go install no longer installs libraries for non-main packages to GOPATH/pkg, and go list no longer reports a Target field for such packages. (In module mode, compiled packages are stored in the build cache only, but a bug had caused the GOPATH install targets to unexpectedly remain in effect.)

go version

The go version -m command now supports reading more types of Go binaries, most notably, Windows DLLs built with go build -buildmode=c-shared and Linux binaries without execute permission.

Vet

TODO: https://go.dev/issue/48801: check for time formats with 2006-02-01

Runtime

TODO: complete this section, or delete if not needed

Compiler

TODO: https://go.dev/issue/49390: clarify whether "-l" and "-N" compiler flags are actually supported

Linker

TODO: complete this section, or delete if not needed

Bootstrap

TODO: https://go.dev/issue/44505: adopt Go 1.17.13 as bootstrap toolchain for Go 1.20

Core library

New crypto/ecdh package

TODO: complete this section

Minor changes to the library

As always, there are various minor changes and updates to the library, made with the Go 1 promise of compatibility in mind. There are also various performance improvements, not enumerated here.

TODO: complete this section

bytes

TODO: https://go.dev/cl/407176: strings, bytes: add CutPrefix and CutSuffix

TODO: https://go.dev/cl/359675: bytes: add Clone function

crypto/elliptic

TODO: https://go.dev/issue/34648: automatically upgrade CurveParams for known curves and deprecate custom ones

crypto/subtle

TODO: https://go.dev/issue/53021: add XORBytes

TODO: https://go.dev/cl/421435: crypto/subtle: add XORBytes; modified api/next/53021.txt

debug/elf

TODO: https://go.dev/cl/420982: debug/elf: add new-style LoongArch reloc types; modified api/next/54222.txt

debug/pe

TODO: https://go.dev/cl/421357: debug/pe: add IMAGE_FILE_MACHINE_RISCV{32,64,128}; modified api/next/54251.txt

encoding/binary

TODO: https://go.dev/cl/420274: encoding/binary: ReadUvarint return io.ErrUnexpectedEOF when read at least 1 byte

encoding/xml

TODO: https://go.dev/issue/53346: Add (*Encoder).Close() to check for unclosed elements

TODO: https://go.dev/cl/424777: encoding/xml: add (*Encoder).Close

fmt

TODO: https://go.dev/issue/51668: add FormatString(State) string

TODO: https://go.dev/cl/400875: fmt: add a function to recover the original format string given a State; modified api/next/51668.txt

go/build

TODO: https://go.dev/cl/421434: go/build: add GO$GOARCH-based ToolTags

go/token

TODO: https://go.dev/cl/410114: go/token: add (*FileSet).RemoveFile(*File) method

io

TODO: https://go.dev/issue/45899: add OffsetWriter, NewOffsetWriter

TODO: https://go.dev/cl/406776: io: add OffsetWriter, NewOffsetWriter; modified api/next/45899.txt

net/http

TODO: https://go.dev/issue/41773: add Server.OptionsHandler to allow custom handling of OPTIONS *

TODO: https://go.dev/cl/356410: net/http: add Server.DisableOptionsHandler for custom handling of OPTIONS *; modified api/next/41773.txt

net/http/httputil

TODO: https://go.dev/issue/50465: add X-Forwarded-Proto and X-Forwarded-Host by default

TODO: https://go.dev/issue/53002: replace Director with Rewrite

TODO: https://go.dev/cl/407214: net/http/httputil: add ReverseProxy.Rewrite; modified api/next/53002.txt

TODO: https://go.dev/cl/407414: net/http/httputil: add X-Forwarded-{Host,Proto} headers in ReverseProxy

os/exec

The new Cmd fields Cancel and WaitDelay specify the behavior of the Cmd when its associated Context is canceled or its process exits with I/O pipes still held open by a child process.

strconv

TODO: https://go.dev/cl/345488: strconv: optimize Parse for []byte arguments

strings

TODO: https://go.dev/issue/42537: add CutPrefix and CutSuffix

TODO: https://go.dev/issue/45038: bytes, strings: add Clone

syscall

TODO: https://go.dev/cl/407574: syscall: add new CLONE_ flags for Linux

time

TODO: https://go.dev/issue/52746: add DateTime, DateOnly, TimeOnly format constants

TODO: https://go.dev/cl/412495: time: add DateTime, DateOnly, and TimeOnly

unicode/utf16

TODO: https://go.dev/issue/51896: add AppendRune

TODO: https://go.dev/cl/409054: unicode/utf16: add AppendRune; modified api/next/51896.txt