From 5f153109bae21ad636565c20fbd9d8e6cb02f67c Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 8 Jun 2023 19:12:49 +0200 Subject: [PATCH] Refactor formatNode --- cmd/restic/format.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/restic/format.go b/cmd/restic/format.go index 0bc6d9fd2..063cd4e71 100644 --- a/cmd/restic/format.go +++ b/cmd/restic/format.go @@ -16,9 +16,11 @@ func formatNode(path string, n *restic.Node, long bool, human bool) string { var mode os.FileMode var target string - size := fmt.Sprintf("%6d", n.Size) + var size string if human { size = ui.FormatBytes(n.Size) + } else { + size = fmt.Sprintf("%6d", n.Size) } switch n.Type {