Go 1.19 is not yet released. These are work-in-progress release notes. Go 1.19 is expected to be released in August 2022.
TODO: complete this section
TODO: complete this section, or delete if not needed
TODO: complete this section, or delete if not needed
TODO: complete this section.
The -trimpath
flag, if set, is now included in the build settings
stamped into Go binaries by go
build
, and can be
examined using
go
version
-m
or debug.ReadBuildInfo
.
go
generate
now sets the GOROOT
environment variable explicitly in the generator's environment, so that
generators can locate the correct GOROOT
even if built
with -trimpath
.
go
test
and go
generate
now place
GOROOT/bin
at the beginning of the PATH
used for the
subprocess, so tests and generators that execute the go
command
will resolve it to same GOROOT
.
go
env
now quotes entries that contain spaces in
the CGO_CFLAGS
, CGO_CPPFLAGS
, CGO_CXXFLAGS
, CGO_FFLAGS
, CGO_LDFLAGS
,
and GOGCCFLAGS
variables it reports.
unix
build constraint
The build constraint unix
is now recognized
in //go:build
lines. The constraint is satisfied
if the target operating system, also known as GOOS
, is
a Unix or Unix-like system. For the 1.19 release it is satisfied
if GOOS
is one of
aix
, android
, darwin
,
dragonfly
, freebsd
, hurd
,
illumos
, ios
, linux
,
netbsd
, openbsd
, or solaris
.
In future releases the unix
constraint may match
additional newly supported operating systems.
TODO: complete this section, or delete if not needed
The compiler now uses
a jump
table to implement large integer and string switch statements.
Performance improvements for the switch statement vary but can be
on the order of 20% faster.
(GOARCH=amd64
and GOARCH=arm64
only)
TODO: https://go.dev/cl/402374: enable regabi on riscv64 by default
TODO: https://go.dev/cl/391014: The Go compiler now requires the -p=importpath flag, which is already supplied by the go command and by Bazel. Any other build systems that invoke the Go compiler directly will need to make sure they pass this flag as well in order to use Go 1.19.: cmd/compile: require -p flag
TODO: complete this section, or delete if not needed
TODO: complete this section, or delete if not needed
The sync/atomic
package defines new atomic types
Bool
,
Int32
,
Int64
,
Uint32
,
Uint64
,
Uintptr
, and
Pointer
.
These types hide the underlying values so that all accesses are forced to use
the atomic APIs.
Pointer
also avoids
the need to convert to
unsafe.Pointer
at call sites.
Int64
and
Uint64
automatically
receive 64-bit alignment on ARM, 386, and 32-bit MIPS required for 64-bit
atomics on these systems.
TODO: complete this section
As always, there are various minor changes and updates to the library, made with the Go 1 promise of compatibility in mind.
TODO: complete this section
TODO: https://go.dev/cl/387976: permit zip files to have prefixes
TODO: https://go.dev/cl/370894: batch and buffer calls to getrandom/getentropy
TODO: https://go.dev/cl/375215: use fast key erasure RNG on plan9 instead of ANSI X9.31
TODO: https://go.dev/cl/390038: remove all buffering
The tls10default
GODEBUG
option has been
removed. It is still possible to enable TLS 1.0 client-side by setting
Config.MinVersion
.
TODO: https://go.dev/cl/285872: disable signing with MD5WithRSA
TODO: https://go.dev/cl/386017: add AppendByteOrder
TODO: https://go.dev/cl/405675: add Reader.InputOffset method
TODO: https://go.dev/cl/313329: add TextVar function
TODO: https://go.dev/cl/406177: add Append, Appendln, Appendf
TODO: https://go.dev/cl/403696: parser to accept ~x as unary expression
Draw
with the Src
operator preserves
non-premultiplied-alpha colors when destination and source images are
both *image.NRGBA
(or both *image.NRGBA64
).
This reverts a behavior change accidentally introduced by a Go 1.18
library optimization, to match the behavior in Go 1.17 and earlier.
TODO: https://go.dev/cl/396215: add an Err field to LimitedReader
TODO: https://go.dev/cl/400236: NopCloser forward WriterTo implementations if the reader supports it
On Windows only, the mime package now ignores a registry entry
recording that the extension .js
should have MIME
type text/plain
. This is a common unintentional
misconfiguration on Windows systems. The effect is
that .js
will have the default MIME
type text/javascript; charset=utf-8
.
Applications that expect text/plain
on Windows must
now explicitly call
AddExtensionType
.
The pure Go resolver will now use EDNS(0) to include a suggested
maximum reply packet length, permitting reply packets to contain
up to 1232 bytes (the previous maximum was 512).
In the unlikely event that this causes problems with a local DNS
resolver, setting the environment variable
GODEBUG=netdns=cgo
to use the cgo-based resolver
should work.
Please report any such problems on the
issue tracker.
When a net package function or method returns an "I/O timeout"
error, the error will now satisfy errors.Is(err,
context.DeadlineExceeded)
. When a net package function
returns an "operation was canceled" error, the error will now
satisfy errors.Is(err, context.Canceled)
.
These changes are intended to make it easier for code to test
for cases in which a context cancellation or timeout causes a net
package function or method to return an error, while preserving
backward compatibility for error messages.
TODO: https://go.dev/cl/400654: permit use of Resolver.PreferGo, netgo on Windows and Plan 9
TODO: https://go.dev/cl/269997: allow sending 1xx responses
TODO: https://go.dev/cl/374654: add JoinPath, URL.JoinPath
TODO: https://go.dev/cl/392415: raise open file rlimit at startup
An exec.Cmd
with a non-empty Dir
and a
nil Env
now implicitly sets the PWD
environment
variable for the subprocess to match Dir
.
The new method (*exec.Cmd).Environ
reports the
environment that would be used to run the command, including the
aforementioned PWD
variable.
The method Value.Bytes
now accepts addressable arrays in addition to slices.
The methods Value.Len
and Value.Cap
now successfully operate on a pointer to an array and return the length of that array, to match what the builtin len
and cap
functions do.
The GOROOT
function now returns the empty string
(instead of "go"
) when the binary was built with
the -trimpath
flag set and the GOROOT
variable is not set in the process environment.
The race detector has been upgraded to use thread sanitizer version v3.
When used together with the CPU profiler, the execution trace includes CPU profile samples.
The sorting algorithm has been rewritten to use pattern-defeating quicksort, which is faster for several common scenarios.
Quote
and related functions now quote the rune 007F as \x7f
,
not \u007f
.
TODO: https://go.dev/cl/393515: add Duration.Abs