Introduction: On August 2, 2022, the Go team released a new version 1.19.
After a period of time, Go 1.19 is now officially released and can be obtained by visiting the download page.
https://go.dev/dl/
"Most of its changes are in the toolchain, runtime, and library implementation. As always, this release maintains the Go 1 compatibility promise. We expect nearly all Go programs to continue to compile and run as before."
This is how the Go team blog describes it.
Version 1.19 includes some memory model adjustments, LoongArch port, improvements to the document comment mechanism and other optimizations. The specific update list is as follows:
-
Go 1.19 rounds out and improves on Go 1.18.
The development team focused generics development for Go 1.19 on addressing some minor issues and corner cases reported by the community, as well as significant performance improvements (up to 20% performance improvements for some generic programs).
-
Documentation comments now support links, lists, and clearer heading syntax.
This change helps users write cleaner, easier-to-navigate documentation comments, especially in packages with large APIs. As part of this change, gofmt now reformats documentation comments to apply standard formatting to the use of these functions. See the "Go Doc Comments" for all the details.
-
Go's memory model now explicitly defines the behavior of the sync/atomic package.
The formal definition of happens-before relationships has been modified to align with the memory models 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 in the sync/atomic package, such as atomic.Int64 and atomic.Pointer[T], to make it easier to work with atomic values.
-
For security reasons, the os/exec package no longer respects relative paths in PATH lookups.
See the package documentation for details. The existing use of golang.org/x/sys/execabs can be moved back to os/exec in programs built only with Go 1.19 or later.
-
The garbage collector adds support for soft memory limits, discussed in detail in the new garbage collection guide.
This limit is especially useful for optimizing Go programs to run as efficiently as possible in containers with dedicated amounts of memory.
-
The new build constraint unix is satisfied when the target operating system (GOOS) is any Unix-like system.
Today, Unix-like refers to all of Go's target operating systems, except js, plan9, windows, and zos.
In addition, 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, use of large switch statements on x86-64 and ARM64 Jump tables, support for debugger injection function calls on ARM64, register ABI support on RISC-V, and experimental support for Linux running on LoongArch 64-bit architecture ( GOARCH=loong64 ).
Edit: Field Chief
Related Reading:
After Python, Go also runs smoothly on the browser
Go language release major update: version 1.18 officially released