make(T, ...) — initializes slices, maps, channels. new(T) — allocates zeroed memory, returns *T.
For slices, make([]int, 0, 50) preallocates capacity. For maps/channels, it creates internal structures. Result is ready to use.
1s := make([]int, 0, 50) // preallocated2m := make(map[string]int) // ready3ch := make(chan int, 10) // buffered
new returns pointer to zeroed memory. For slices/maps/channels, zero value is nil.
1p := new(int) // *int → 02s := new([]int) // *[]int → nil
When to use:
Common mistakes:
new([]int) → nil.make([]int, 10) → len=10.make on wrong type.