We break down practical “rakes” (common pitfalls) of embedded resources in Go: how a path inside
fs.FS differs from an OS path, why you must not build paths for
embed.FS using
filepath.Join, how to choose
//go:embed patterns, how to inspect contents with
fs.ReadDir, why you may want to “re-root” resources via
fs.Sub, and what you pay for convenience: bigger binaries, full-file reads via
fs.ReadFile, mandatory rebuilds, and no “secrecy” for embedded files.