Learn how Go embeds local assets into a program and how the io/fs helpers browse those embedded files.
- 📦 Embeds sample files at compile time with the standard library
- 🗂️ Lists embedded entries with fs.ReadDir and fs.WalkDir
- 🔎 Matches files with fs.Glob and reads a sub-filesystem with fs.Sub
- 🧩 Uses no third-party dependencies
No hosted demo is published. Run the project locally using the Quick Start command below.
go run .
- Go 1.22+
- Go standard library
- embed and io/fs
main.go Embed and filesystem demonstrations
assets/ Embedded sample files
assets/docs/ Nested documentation examples
go.mod Module metadata
- Add a flag to select a subdirectory
- Show file sizes and MIME hints
Issues and pull requests are welcome. Keep changes focused, document behavior, and add a small reproducible example for new features.
Released under the MIT License. See LICENSE.