Canonical guidance

Use when

Avoid

Preferred pattern

buf := make([]byte, 0, 1024)
buf = append(buf, data...)

Anti-pattern

Explanation: This is tempting because both forms allocate something, but new and make produce different kinds of values with different readiness for use.

Why

Related pages

Sources