From 368dc17a4c754802caf16809b135019e9eaa4792 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Wed, 1 Nov 2017 14:20:38 -0700 Subject: [PATCH] testutil: add Size to DumpDir output Signed-off-by: Stephen J Day --- testutil/helpers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testutil/helpers.go b/testutil/helpers.go index fd042a241..972d685c0 100644 --- a/testutil/helpers.go +++ b/testutil/helpers.go @@ -2,6 +2,7 @@ package testutil import ( "flag" + "fmt" "io/ioutil" "os" "path/filepath" @@ -35,7 +36,7 @@ func DumpDir(t *testing.T, root string) { if err != nil { return err } - t.Log(fi.Mode(), path, "->", target) + t.Log(fi.Mode(), fmt.Sprintf("%10s", ""), path, "->", target) } else if fi.Mode().IsRegular() { p, err := ioutil.ReadFile(path) if err != nil { @@ -46,10 +47,9 @@ func DumpDir(t *testing.T, root string) { if len(p) > 64 { // just display a little bit. p = p[:64] } - - t.Log(fi.Mode(), path, "[", strconv.Quote(string(p)), "...]") + t.Log(fi.Mode(), fmt.Sprintf("%10d", fi.Size()), path, "[", strconv.Quote(string(p)), "...]") } else { - t.Log(fi.Mode(), path) + t.Log(fi.Mode(), fmt.Sprintf("%10d", fi.Size()), path) } return nil