You can use the os
package in Golang to copy a directory. Here's an example function that takes in two paths where the first path is the source directory and the second path is the destination directory.
main.go1622 chars80 lines
This copyDir
function recursively copies all the files and subdirectories in the source directory to the destination directory. The copyFile
function is called for each file encountered and executes the actual copy operation.
gistlibby LogSnag