go-copyfs is a library to copy a given fs.FS into the local filesystem.
Note: go-copyfs doesn't support the symlink because fs.FS doesn't support as of Go 1.18.'
Note: Go 1.23.0 now includes the almost same function as os.CopyFS function.
When I was writing tests, I wanted to extract files in embed.FS into the local filesystem because the code only accept a filename in the local filesystem. I had to write some code to deal with the temporary directory and copy the files into it.
That's why I wrote this small library, go-copyfs.
See copyfs_test.go
See LICENSE