✨ New post

Super quick one about a little change in Go 1.26 that may massively simplify your codebase.

“No temp variables needed for pointers in Go 1.26”

https://pawelgrzybek.com/no-temp-variables-needed-for-pointers-in-go-1-26/

#golang

No temp variables needed for pointers in Go 1.26 | pawelgrzybek.com

Go 1.26 makes pointer creation a lot easier by allowing an expression as an argument. This little change can reduce a ton of boilerplate in your codebase.

pawelgrzybek.com
@pawelgrzybek actually huge for me, since structs that are unmarshaled from json tend to have "optional" fields as pointers, often to primitives, leading to tedious manual initialization of those fields. Thanks Go 😁
@calinpristavu Yeah, this precisely is the example given by the go team on the announcement blog post. Vey good use case.