From 35f052e29a00e40d1053e8162d271c0d866258f0 Mon Sep 17 00:00:00 2001 From: Jiacheng Xu <169599847+Stardust0831@users.noreply.github.com> Date: Wed, 5 Aug 2026 02:19:10 +0800 Subject: [PATCH] size: include source in JSON output - fixes #5429 --- cmd/size/size.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/size/size.go b/cmd/size/size.go index a396ddaa1..b30aa5dfe 100644 --- a/cmd/size/size.go +++ b/cmd/size/size.go @@ -52,9 +52,10 @@ of the size command.`, cmd.Run(false, false, command, func() error { var err error var results struct { - Count int64 `json:"count"` - Bytes int64 `json:"bytes"` - Sizeless int64 `json:"sizeless"` + Count int64 `json:"count"` + Bytes int64 `json:"bytes"` + Sizeless int64 `json:"sizeless"` + Fs string `json:"fs"` } results.Count, results.Bytes, results.Sizeless, err = operations.Count(context.Background(), fsrc) @@ -65,6 +66,7 @@ of the size command.`, fs.Logf(fsrc, "Size may be underestimated due to %d objects with unknown size", results.Sizeless) } if jsonOutput { + results.Fs = args[0] return json.NewEncoder(os.Stdout).Encode(results) } count := strconv.FormatInt(results.Count, 10)