Go - New

About

The expression new(T):

new is a predeclared function, not a keyword,

Example

p := new(int) 
fmt.Println(*p) // "0" 

then:

  • p has the type *int, points to an unnamed int variable

Documentation / Reference


Powered by ComboStrap