Closed SameerPr closed 1 year ago
Use temp dir as a temporary dest and then rename (mv) it to the dest which you really copy the src at.
I have used this for now
destination := "./dest" // defined destination
opt := Options{
Skip: func(info os.FileInfo, src, dest string) (bool, error) {
return strings.HasPrefix(src, path.Clean(destination)), nil
},
}
err := Copy(source, destination, opt)
cool hack
If the source is current directory and we specify a destination to be inside current working directory. it goes on a loop copying the destination folder recursively
Error: