diff --git a/util/file.go b/util/file.go index fc7c18f..4859a42 100644 --- a/util/file.go +++ b/util/file.go @@ -123,8 +123,17 @@ func (*myfile) CopyDir(source string, dest string) (err error) { return err } - directory, _ := os.Open(source) + directory, err := os.Open(source) + if err != nil { + return err + } + + defer directory.Close() + objects, err := directory.Readdir(-1) + if err != nil { + return err + } for _, obj := range objects { srcFilePath := filepath.Join(source, obj.Name())