make (built-in)

The built-in Go function that creates a ready-to-use map, slice or channel, such as make(map[string]bool) or make(chan string).

In more detail

Maps and channels must be made before you store into them or send on them. For channels, a second argument sets the buffer size, as in make(chan int, 2). It is unrelated to the GNU make build tool.

Example

seen := make(map[string]bool)

Related terms

Taught in

References