Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

lsjson: fix unterminated JSON in the presence of errors

Nick Craig-Wood1415666074d3
diff --git a/cmd/lsjson/lsjson.go b/cmd/lsjson/lsjson.go
index b52a45741..ddb2e1d44 100644
--- a/cmd/lsjson/lsjson.go
+++ b/cmd/lsjson/lsjson.go
@@ -121,14 +121,11 @@ can be processed line by line as each item is written one to a line.
}
return nil
})
- if err != nil {
- return err
- }
if !first {
fmt.Println()
}
fmt.Println("]")
- return nil
+ return err
})
},
}