|
Go 1.22 Released — Keeping in tradition with most even numbered Go releases landing in February, Go 1.22 is here! In theory, the upgrade is as simple as updating the version in go.mod (just be careful of any net/http.ServeMux breakages..) whereupon you'll be able to enjoy a variety of improvements:
- Small performance improvements, though with larger potential gains through improvements to profile-guided optimization.
- Variables defined in
for loops are made anew on each iteration.
-
for loops may now range over integers.
-
range-over function iterators make an appearance, behind a flag for now.
- Big enhancements to
http/ServeMux and its routing abilities. Here's a quick comparison.
-
math/rand/v2 – the motivation was explained here.
- A cute enhancement that stood out to me: "When
io.Copy copies from a TCPConn to a UnixConn it will now use Linux's splice(2) system call if possible, using the new method TCPConn.WriteTo. "
To go through everything, the full Go 1.22 release notes are the place to.. Go.
Eli Bendersky and the Go team
|
Go! Experts at Your Service — Do you need help filling skill gaps, speeding up development & creating high performing software with Go, Docker, K8s, Terraform and Rust? We’ll help you maximize your architecture, structure, tech-debt and human capital.
Ardan Labs Consulting sponsor
|
Reducing Go Dependencies — A case study of dependency reduction in Huma, a Go framework for creating HTTP REST APIs using OpenAPI, which might inspire you to consider similar options for your own projects.
Daniel Taylor
|
Start with the Go Standard Library — Go has a great standard library, so "you should start with it", says Matthew. He also takes time to compare a few of the libraries against third party alternatives.
Matthew Sanabria
|
I Wish Go Had a retry Block — “I kinda wish that Go had some kind of language-level construct for ‘an action that is composed of multiple parts that can fail, and when one fails in a non-permanent way, then the program will wait for some time before trying again’.”
Xe Iaso
|
|