lsjson: fix unterminated JSON in the presence of errors

See: https://forum.rclone.org/t/rclone-lsjson-invalid-json-produced-no-at-the-end/22046
This commit is contained in:
Nick Craig-Wood 2021-02-02 17:46:10 +00:00
parent bae550c71e
commit 1415666074

View File

@ -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
})
},
}