Canonical guidance

Use when

Avoid

Preferred pattern

import "embed"

//go:embed templates/*.html
var templates embed.FS

Anti-pattern

Explanation: This anti-pattern is tempting because it removes one deployment problem, but it quietly bloats the binary and hides asset ownership.

Why

Related pages

Sources