Skip to content

Commit

Permalink
FMWK-399-remove-artifacts-flag
Browse files Browse the repository at this point in the history
- moved dir check
  • Loading branch information
filkeith committed Sep 19, 2024
1 parent 00b040b commit 3e59af8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions io/local/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ func (r *Reader) StreamFiles(
defer close(readersCh)
// If it is a folder, open and return.
if r.isDir {
err := r.checkRestoreDirectory()
if err != nil {
errorsCh <- err
return
}
r.streamDirectory(ctx, readersCh, errorsCh)

Check failure on line 120 in io/local/reader.go

View workflow job for this annotation

GitHub Actions / lint

expressions should not be cuddled with blocks (wsl)

Check failure on line 120 in io/local/reader.go

View workflow job for this annotation

GitHub Actions / lint

expressions should not be cuddled with blocks (wsl)
return

Check failure on line 121 in io/local/reader.go

View workflow job for this annotation

GitHub Actions / lint

return statements should not be cuddled if block has more than two lines (wsl)

Check failure on line 121 in io/local/reader.go

View workflow job for this annotation

GitHub Actions / lint

return statements should not be cuddled if block has more than two lines (wsl)
}
Expand All @@ -123,12 +128,6 @@ func (r *Reader) StreamFiles(
func (r *Reader) streamDirectory(
ctx context.Context, readersCh chan<- io.ReadCloser, errorsCh chan<- error,
) {
err := r.checkRestoreDirectory()
if err != nil {
errorsCh <- err
return
}

fileInfo, err := os.ReadDir(r.path)
if err != nil {
errorsCh <- fmt.Errorf("failed to read path %s: %w", r.path, err)
Expand Down

0 comments on commit 3e59af8

Please sign in to comment.