A package for folder cloning.
Install the package to your $GOPATH with the go get tool from shell:
$ go get -u github.com/galijot/cloner
- Import the package like
import "github.com/galijot/cloner"
- Create a
struct
& implementCloneOptions
interface.
type options struct {
includeHiddenItems bool
}
func (o options) IncludeHidden() bool {
return o.includeHiddenItems
}
- Send the source and destination paths along options to
cloner
'sClone
function
cloner.Clone("path/to/src/dir/", "path/to/dst/dir/", options{false})
- That's it 🎉
Also, the example project is available here.
cloner includes few additional standalone sub-packages;