Click to follow

On August 2, the Go team released Go 1.19, which can be obtained by visiting the download page [1] .

Go 1.19 improves upon and improves upon Go 1.18 [2] , and generics development in Go 1.19 is focused on addressing subtle issues and corner cases reported to us by the community, as well as significant performance improvements (up to 20% for some generic programs).

Documentation comments now support links, lists, and cleaner heading syntax [3] . This change helps users write cleaner, easier-to-navigate documentation comments, especially in packages with large APIs. As part of this change, gofmtdocumentation comments are now reformatted to apply standard formatting to the use of these functions. See " Go Doc Comments [4] " for all the details.

Go's memory model [5] now explicitly defines the behavior of the sync/atomic package [6] . The formal definition of the relationship that happened before has been modified to align with the memory model used by C, C++, Java, JavaScript, Rust, and Swift. Existing programs are not affected. As the memory model has been updated, there are also new types [7] in the sync/atomic package , such as atomic.Int64 [8] and atomic.Pointer[T] [9] , to make it easier to work with atomic values.

For security reasons [10] , the os/exec package no longer respects relative paths in PATH lookups. See the package documentation [11] for details . The existing use of golang.org/x/sys/execabs[12 ] can be moved back to os/exec in programs built with Go 1.19 or later only.

The garbage collector adds support for soft memory limits, discussed in detail in the new garbage collection guide [13] . This limit is especially useful for optimizing Go programs to run as efficiently as possible in containers with dedicated amounts of memory.

unixThe new build constraints are satisfied when the target operating system ( GOOS) is any Unix-like system. Today, Unix-like means all of Go's target operating systems, except js, plan9, windowsand zos.

Finally, Go 1.19 includes various performance and implementation improvements, including dynamically adjusting the initial goroutine stack to reduce stack copying, automatic use of additional file descriptors on most Unix systems, skipping for large switch statements on x86-64 and ARM64 Turn tables, support for debugger injection function calls on ARM64, register ABI support on RISC-V, and GOARCH=loong64experimental support for Linux running on LoongArch ( ) on the Loongson 64-bit architecture.

Reference

[1]

Download page:https://go.dev/dl/

[2]

Go 1.18:https://go.dev/blog/go1.18

[3]

Links, lists and cleaner header syntax:https://go.dev/doc/comment

[4]

Go Doc Comments:https://go.dev/doc/comment

[5]

Go's memory model:https://go.dev/ref/mem

[6]

sync/atomic package:https://go.dev/pkg/sync/atomic/

[7]

There are also new types in the sync/atomic package:https://go.dev/doc/go1.19#atomic_types

[8]

atomic.Int64:https://go.dev/pkg/sync/atomic/#Int64

[9]

atomic.Pointer[T]:https://go.dev/pkg/sync/atomic/#Pointer

[10]

Security reasons:https://go.dev/blog/path-security

[11]

Package Documentation:https://go.dev/pkg/os/exec/#hdr-Executables_in_the_current_directory

[12]

golang.org/x/sys/execabs:https://pkg.go.dev/golang.org/x/sys/execabs

[13]

New Garbage Collection Guidelines:https://go.dev/doc/gc-guide#Memory_limit