baggiiiie

~

/

zettelkasten

/

go make

go-make

Aug 08, 2025

  • learning
  • go
  • programming

make

tags: learning go programming

content

// func make([]T, len, cap) []T
mySlice := make([]int, 1, 5)
fmt.Println(mySlice) // [0]
 
// the capacity argument is usually omitted and defaults to the length
mySlice := make([]int, 5)
  • make takes Type, length, capacity, returns Type (NOT a pointer to the type)
  • builtin package - builtin - Go Packages

up

  • go-slice-and-array

down

reference


Graph View

  • make
  • content
  • up
  • down
  • reference

Backlinks

  • go-make-new-map
  • go-map-init
  • go-nil-empty

baggiiiie's learning notes on tech stuff