Skip to content

Commit

Permalink
fix: ensure error returns before attrs is accessed (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Isitha Subasinghe <[email protected]>
  • Loading branch information
isubasinghe authored Mar 21, 2023
1 parent d02cf21 commit 68bf799
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workflow/artifacts/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ func listByPrefix(client *storage.Client, bucket, prefix, delim string) ([]strin
if err == iterator.Done {
break
}
if err != nil {
return nil, err
}
// skip "folder" path like objects
// note that we still download content (including "subfolders")
// this is just a consequence of how objects are stored in GCS (no real hierarchy)
if strings.HasSuffix(attrs.Name, "/") {
continue
}
if err != nil {
return nil, err
}
results = append(results, attrs.Name)
}
return results, nil
Expand Down

0 comments on commit 68bf799

Please sign in to comment.