Go programming language released new 1.25 version on Tuesday after another 6 months of development.
The new release introduced new Go command options, runtime and compiler changes, some new packages, and platform changes.
The go doc
command in the release introduced new -http
option, to start a documentation server showing documentation for the requested object, and open it in the default web browser.
go version
command now has -json
option that outputs the runtime/debug.BuildInfo in JSON format.
There are as well new go.mod ignore
directive to specify directories the go command should ignore, and, new work
package pattern matches all packages in the work modules.
The go vet
static analysis tool in the release got 2 new analyzers. They are waitgroup
to check for misuses of sync.WaitGroup, and hostport
that reports uses of fmt.Sprintf(“%s:%d”, host, port) to construct addresses for net.Dial.
Go 1.25 introduced new experimental garbage collector, which can be enabled by setting GOEXPERIMENT=greenteagc
at build time. The new garbage collector improves the performance of marking and scanning small objects, and expects a 10—40% reduction in garbage collection overhead cost.
The release also changed the default behavior of the GOMAXPROCS. In Linux, it will default to the number of cgroup CPU bandwidth limit if it’s lower than an the number of logical CPUs available. And, the runtime will periodically updates GOMAXPROCS (on all OSes) if the number of either bandwidth limit or logical CPUs change.
The compiler and linker in Go 1.25 now generate debug information using DWARF 5, reducing the space for debugging information as well as the time for linking.
The new Golang release also added new testing/synctest
package provides support for testing concurrent code. As well, it introduced an experimental JSON implementation, along with encoding/json/v2
and encoding/json/jsontext
packages.
Other changes include:
go build -asan
now defaults to doing leak detection at program exit.- Support using a subdirectory of a repository as the path for a module root
- New API for a lightweight way to capture a runtime execution trace.
- Annotate anonymous memory mappings on Linux with Kernel that support it.
- New
-funcalign=N
linker option. - Remove the notion of core types in the language specification.
- Support
plugin
build mode for Linux on riscv64, and more support on Linux/loong64. - For mac, requires macOS 12 Monterey or later.
Get Go 1.25
The official release note for Go 1.25 is available at this page.
While, the package for Linux, Windows, and macOS are available to download at the link below along with source tarball:
For Ubuntu users who are new to Go, see this step by step guide to install the language.