Go Built-In Function new
Jump to navigation
Jump to search
External
- Specification https://golang.org/ref/spec#Allocation
Internal
Overview
The new() built-in function takes a type as argument, allocates memory of the given type and returns a pointer to it.
var ptr *some_type ptr = new(some_type)