From 1415666074d3af72ef085596ac591a0df56c72ab Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 2 Feb 2021 17:46:10 +0000 Subject: [PATCH] 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 --- cmd/lsjson/lsjson.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 }) }, }