Home DEVELOPER Go programming language 1.23 expands iterators and introduces telemetry

Go programming language 1.23 expands iterators and introduces telemetry

0


Go 1.23 was released every six months. The releases mainly bring extensions to the standard library and toolchain.

Advertisement


Among the linguistic innovations, extended iterators are worth mentioning. The team already had that in Go 1.22 Range-over-Func experiment Started as an approach to using a custom iterator for function values.

Go standard library moves packages to current release iter one that provides basic definitions for custom iterators. The Go team, on the other hand, has packages slices And maps Extended to work with repeaters.

Among other things, there is Keys Returns an iterator over all keys of the map. For slices there Backward Returns an iterator that loops backwards through the slices. Additional additions can be found In the iteration section in the release notes,

BREAKING GOOGLE: The US is considering a plan to end the search engine’s monopoly

Other than this iter Go 1.23 has two additional new packages in the standard library: structs allows the properties of struct-Types of packages that change the memory layout, among other things. unique Canonicalization serves to bring comparable values ​​into a normal form. This allows the program to deduplicate values ​​efficiently.

Go Telemetry is a new system that collects toolchain telemetry data. It is designed as an opt-in system: by default, tools in the Go toolchain only collect statistics that can be evaluated locally. Who go telemetry on Approximately once a week a subset of the information is transmitted to telemetry.go.dev. There are charts on the site For some user data.



Shortly after the official launch of telemetry, public data, as shown here, became manageable thanks to the Go language server gopls (“Go please”).

(Image: Screenshot (Reinald Menz-Sonnentag))

Telemetry can be done with parameters off You can also disable it completely so that Go does not store any usage data locally. Get details on telemetry and information on data protection in the Go documentation,

goThe command also gets some extensions in the current version. Among other things, the subcommand can vet For checking packages with stdversion-analyzer tests whether individual symbols are newer than the Go version specified in the go.mod configuration file.

There is a matching complement for go mod tidywhich ensures that the go.mod file meets the requirements for packages and dependencies: with the additional flag -diff The command does not change the configuration file, but only displays the necessary changes.

Those marked as preview in the current release are also noteworthy Common types of aliases Introduced in version 1.18 as an extension to generics.

Further innovations in Go 1.23 such as adjustments time-package can be found in the Go Blog. Full list of what’s new can be found in the release notes. Binaries for Linux, Windows, and macOS as well as source code Downloads are available on the page,


(RME)

Kubernetes 1.31 sets new standards in terms of scalability and security

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Exit mobile version