Canonical guidance

Use when

Avoid

Preferred pattern

func CopyJSON(dst io.Writer, src io.Reader) error {
	_, err := io.Copy(dst, src)
	return err
}

Anti-pattern

Explanation: This anti-pattern is tempting because byte slices are easy to inspect, but it turns streaming problems into memory problems.

Why

Related pages

Sources