Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Sep 15, 2024
1 parent 3945418 commit 21fb1d7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions checks/folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,6 @@ func checkLocalFolder(ctx *context.Context, check v1.FolderCheck) pkg.Results {
}

func genericFolderCheck(ctx *context.Context, dirFS artifactFS.Filesystem, path string, recursive bool, filter v1.FolderFilter) (FolderCheck, error) {
return _genericFolderCheck(ctx, true, dirFS, path, recursive, filter)
}

// genericFolderCheckWithoutPrecheck is used for those filesystems that do not support fetching the stat of a directory.
// Eg: s3, gcs.
// It will not pre check whether the given path is a directory.
func genericFolderCheckWithoutPrecheck(ctx *context.Context, dirFS artifactFS.Filesystem, path string, recursive bool, filter v1.FolderFilter) (FolderCheck, error) {
return _genericFolderCheck(ctx, false, dirFS, path, recursive, filter)
}

func _genericFolderCheck(ctx *context.Context, supportsDirStat bool, dirFS artifactFS.Filesystem, path string, recursive bool, filter v1.FolderFilter) (FolderCheck, error) {
result := FolderCheck{}
_filter, err := filter.New()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion checks/folder_gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func CheckGCSBucket(ctx *context.Context, check v1.FolderCheck) pkg.Results {
return results.ErrorMessage(err)
}

folders, err := genericFolderCheckWithoutPrecheck(ctx, fs, check.Path, check.Recursive, check.Filter)
folders, err := genericFolderCheck(ctx, fs, check.Path, check.Recursive, check.Filter)
if err != nil {
return results.ErrorMessage(err)
}
Expand Down
2 changes: 1 addition & 1 deletion checks/folder_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func CheckS3Bucket(ctx *context.Context, check v1.FolderCheck) pkg.Results {
limitFS.SetMaxListItems(ctx.Properties().Int("s3.list.max-objects", 50_000))
}

folders, err := genericFolderCheckWithoutPrecheck(ctx, fs, check.Path, check.Recursive, check.Filter)
folders, err := genericFolderCheck(ctx, fs, check.Path, check.Recursive, check.Filter)
if err != nil {
return results.ErrorMessage(err)
}
Expand Down

0 comments on commit 21fb1d7

Please sign in to comment.