_content/blog/go1.23.md
Today the Go team is happy to release Go 1.23, which you can get by visiting the download page.
If you already have Go 1.22 or Go 1.21 installed on your machine,
you can also try go get [email protected] in an existing module.
This will download the new toolchain and let you begin using it
in your module right away. At some later point, you can follow up
with go get [email protected] when you're ready to fully switch to Go 1.23
and have that be your module's minimum required Go version.
See Managing Go version module requirements with go get
for more information on this functionality.
Go 1.23 comes with many improvements over Go 1.22. Some of the highlights include:
Range expressions in a "for-range" loop may now be iterator functions,
such as func(func(K) bool).
This supports user-defined iterators over arbitrary sequences.
There are several additions to the standard slices and maps
packages that work with iterators, as well as a new iter package.
As an example, if you wish to collect the keys of a map m into a slice
and then sort its values, you can do that in Go 1.23 with slices.Sorted(maps.Keys(m)).
Go 1.23 also includes preview support for generic type aliases.
Read more about language changes and iterators in the release notes.
go command has new conveniences. For example, running go env -changed makes it easier to
see only those settings whose effective value differs from the default value, and
go mod tidy -diff helps determine the necessary changes to the go.mod and go.sum files
without modifying them.
Read more on the Go command in the release notes.go vet subcommand now reports symbols that are too new for the intended Go version.
Read more on tools in the release notes.time.Timer and time.Ticker.
Read more on timer changes in the release notes.iter, structs, and unique.
Package iter is mentioned above.
Package structs defines marker types to modify the properties of a struct.
Package unique provides facilities for canonicalizing ("interning") comparable
values.
Read more on new standard library packages
in the release notes.godebug directive in go.mod and go.work files to
allow separate control of the default GODEBUGs and the “go” directive of go.mod,
in addition to //go:debug directive comments made available two releases ago (Go 1.21).
See the updated documentation on Default GODEBUG Values.openbsd/riscv64).
There are several minor changes relevant to Linux, macOS, ARM64, RISC-V, and WASI.
Read more on ports in the release notes.We encourage everyone to read the Go 1.23 release notes for the complete and detailed information on these changes, and everything else that's new to Go 1.23.
Over the next few weeks, look out for follow-up blog posts that will go in more depth
on some of the topics mentioned here, including “range-over-func”, the new unique package,
Go 1.23 timer implementation changes, and more.
Thank you to everyone who contributed to this release by writing code and documentation, reporting bugs, sharing feedback, and testing the release candidates. Your efforts helped to ensure that Go 1.23 is as stable as possible. As always, if you notice any problems, please file an issue.
Enjoy Go 1.23!