Closed 4k1k0 closed 1 year ago
It would be super useful if this package could copy embed directories.
For example:
Given the following fs tree:
/ /assets /foo foo.txt bar.txt hello.txt goodbye.txt main.go
It could use the embed FS to use the copy function.
//go:embed assets var assets embed.FS func foo() error { file, err := assets.Open("assets") if err != nil { return err } err := Copy(file, "destination") if err != nil { return err } return nil }
Or maybe use the Option structure
opt := Options{ FS: assets, } err := Copy("assets/foo", "new/destination", opt)
Thank you for your feedback. Let me take time to think of it
@otiai10 https://pkg.go.dev/io/fs#Glob
@otiai10 is this planned to be implemented?
will tackle it this weekend ;)
See v1.12.0
It would be super useful if this package could copy embed directories.
For example:
Given the following fs tree:
It could use the embed FS to use the copy function.
Or maybe use the Option structure