make(T, ...) — initializes slices, maps, channels with usable state. new(T) — allocates zeroed memory, returns *T.
For slices, make([]int, 0, 100) preallocates backing storage. For maps/channels, make creates internal structures. The result is ready to use.
1s := make([]int, 0, 100) // preallocated2m := make(map[string]int) // ready to write3ch := make(chan int, 10) // buffered
new allocates sizeof(T) bytes, zeroes them, returns *T. For slices/maps/channels the zero value is nil — needs make to become usable.
1p := new(int) // *int → 0, usable2s := new([]int) // *[]int → nil, NOT usable
When to use:
&T{...}.Common mistakes:
new([]int) → nil slice, needs make.make([]int, 10) → len=10 (zeros), not empty.make on non-slice/map/channel.