Go · Function
new
Go 1.26 extends the built-in new function. It can now take an expression and return a pointer to a variable initialized with that expression's value.
Last updated
- Since
- Go 1.26
Syntax
new(expression)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
encoding/jsonnewGo 1.26