You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, go:embed allows embedding individual files as strings or []bytes, but directories must go through the embed.FS interface.
Allowing directories to be represented as maps would improve the ergonomics of walking through embedded filesystem trees, since there would no longer be any (nonexistent) errors to handle (or ignore).
Options:
map[string]string and/or map[string][]byte would represent flattened directory hierarchies (similar to how S3 buckets work)
map[string]any would represent the full tree, where keys are directory/file names without slashes, and values are map[string]any | []bytes