Go 1.23 Improves Tools |
Written by Kay Ewbank |
Monday, 26 August 2024 |
Go 1.23 has been released with language improvements to ranges and preview support for generic type aliases, as well as improvements to the Go tools. Since its initial development by Google, Go has matured as an open source project maintained by a team at Google with input from many contributors from the open source community. Go was designed as a systems programming language, and has also been used in high profile commercial successes such as Docker. The new version comes with the ability to use iterator functions such as func(func(K) bool) for Range expressions in a "for-range" loop. The developers say this supports user-defined iterators over arbitrary sequences. Other changes include several additions to the standard slices and maps packages that work with iterators, as well as a new iter package. The preview support for generic type aliases extends Go's existing support for type aliases, which states that while a type alias may refer to a generic type, it can't have its own parameters. The reason the restriction was enforced is because it isn't clear how to handle a type alias with type parameters that have constraints. The change to Go 1.23 allows aliases to have their own type parameters by making the use of the type alias satisfy the constraints. The improvements to the tools start with the addition of Go telemetry. This provides a way to collect usage and breakage statistics to help understand how the Go toolchain is used, and how well it is working. The standard library has also been improved with a better implementation of time.Timer and time.Ticker. The changes mean that Timers and Tickers that are no longer referred to by the program become eligible for garbage collection immediately. Secondly, the timer channel associated with a Timer or Ticker is now unbuffered, meaning Go now guarantees that when calling Reset or Stop methods, the values being sent or returned will be freshly prepared rather than the previous situation where stale values prepared before that call could be sent or received. Go 1.23 is available for download now. More InformationRelated ArticlesGo 1.18 Released With Generics And Fuzzing Insights Into Where Go Is Going A Programmer's Guide To Go Part 2 - Objects And Interfaces A Programmer's Guide To Go Part 3 - Goroutines And Concurrency To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
Last Updated ( Monday, 26 August 2024 ) |