Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #347 Copy folder

Copy the directory path1 to path2, with all its contents

import "os"
err := os.CopyFS(path2, os.DirFS(path1))

1st argument is a string, for the destination folder.
2nd argument is a fs.FS, for the source folder.

New implementation...
< >
programming-idioms.org