Skip to content

Commit 6db3b67

Browse files
authored
Update integrity_test.go
1 parent 193ed97 commit 6db3b67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

integrity_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,11 @@ func downloadParquetFiles(stream string, config MinIoConfig) []string {
212212
f.Close()
213213
}
214214

215-
// Reverse the filenames, because we want latest files first.
216-
for i, j := 0, len(downloadedFileNames)-1; i < j; i, j = i+1, j-1 {
217-
downloadedFileNames[i], downloadedFileNames[j] = downloadedFileNames[j], downloadedFileNames[i]
215+
// Reverse the filenames, because we want latest files first (only if there are multiple files)
216+
if len(downloadedFileNames) > 1 {
217+
for i, j := 0, len(downloadedFileNames)-1; i < j; i, j = i+1, j-1 {
218+
downloadedFileNames[i], downloadedFileNames[j] = downloadedFileNames[j], downloadedFileNames[i]
219+
}
218220
}
219221

220222
slog.Info("downloaded files", "paths", downloadedFileNames)

0 commit comments

Comments
 (0)