liveBook · Manning

Make

make is a Go built-in function that initializes slices, maps, or channels, optionally specifying size or capacity.

How 2 Manning books explain it

Go in Action, Second Edition

make is a Go built-in function that allocates and initializes slices, maps, or channels with a specified type and size parameters.

How it is used
Creates usable slices, maps, and channels for collection growth, map assignment, and goroutine communication.
How deep it goes
Explains slice length, capacity, zero values, and backing storage; contrasts map initialization and demonstrates channel creation without detailing channel internals.
Examples
Shows zero-filled and preallocated slices, empty maps alongside a nil-map panic, and channels carrying feed articles and errors.
What you can do after
Build it from scratch: initialize Go collections and channels, reserve slice capacity, and avoid assignments into nil maps.

Read how Go in Action, Second Edition explains make →

Learn Go with Pocket-Sized Projects

make is a Go built-in function that initializes slices, maps, or channels with specified size-related parameters.

How it is used
Initializes maps and slices while implementing book counting and repeated-book collection.
How deep it goes
Explains allocation, map size hints, and slice length versus capacity, but defers deeper slice internals.
Examples
Demonstrates map counting, explicit map sizing, indexed slices, reserved capacity, and appending repeated books.
What you can do after
Build it from scratch by choosing map size hints and slice length or capacity for collection-based functions.

Read how Learn Go with Pocket-Sized Projects explains make →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.