From bddf17ba4e724bf16f110aa5bd8566b8adac017e Mon Sep 17 00:00:00 2001 From: Cy Allen Scott Date: Fri, 22 Apr 2022 15:05:47 -0400 Subject: [PATCH] refactor: reverting changes no longer needed --- fileutils/dir.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/fileutils/dir.go b/fileutils/dir.go index d32426dc..07a3528e 100644 --- a/fileutils/dir.go +++ b/fileutils/dir.go @@ -6,7 +6,10 @@ import ( "github.com/spf13/afero" ) -func CreateDir(fs afero.Fs, source, dest string) error { +// CopyDir copies a directory from source to dest and all +// of its sub-directories. It doesn't stop if it finds an error +// during the copy. Returns an error if any. +func CopyDir(fs afero.Fs, source, dest string) error { // Get properties of source. srcinfo, err := fs.Stat(source) if err != nil { @@ -19,18 +22,6 @@ func CreateDir(fs afero.Fs, source, dest string) error { return err } - return nil -} - -// CopyDir copies a directory from source to dest and all -// of its sub-directories. It doesn't stop if it finds an error -// during the copy. Returns an error if any. -func CopyDir(fs afero.Fs, source, dest string) error { - err := CreateDir(fs, source, dest) - if err != nil { - return err - } - dir, _ := fs.Open(source) obs, err := dir.Readdir(-1) if err != nil {