Go 1.26 lets new() take an expression, making pointer helpers obsolete
Go 1.26, released on February 10, 2026, allows the built-in new() to accept an expression rather than only a type, so new(42) and new(time.Now()) now compile. This lets developers delete custom pointer helpers like ptr[T], StringPtr and utils/pointer.go, with go fix -newexpr rewriting call sites automatically.
- Go 1.26 shipped on February 10, 2026, allowing new(expr) instead of only new(T)
- Helpers like ptr[T], proto.String and ptr.To from k8s.io/utils can be deleted
- go fix -newexpr rewrites call sites but requires go.mod to declare Go 1.26+
- The feature targets JSON and protobuf, where a pointer marks an optional value
Read next
Gaming