embed package
Canonical docs for the //go:embed directive and the embed.FS file system.
Canonical docs for the //go:embed directive and the embed.FS file system.
- Author: Go Team
- Authority: primary
- Kind: package-doc
- URL: https://pkg.go.dev/embed
What it covers
- //go:embed directive rules
- string and []byte embedding
- embed.FS usage
Why authoritative
Official standard library documentation for compile-time asset embedding.
Use when
- how should I use //go:embed
- when should I use embed.FS
- what can Go embed into a binary
Keywords
- embed, //go:embed, embed.FS, static assets, compile-time assets