From 9e9ca8d4aad2d43df1f816f521a921892ed81385 Mon Sep 17 00:00:00 2001 From: Colin Marc Date: Fri, 31 Oct 2014 18:46:27 +0100 Subject: [PATCH] don't print a leading newline in ls --- cmd/hdfs/ls.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/hdfs/ls.go b/cmd/hdfs/ls.go index 2ffe340..17f6fa9 100644 --- a/cmd/hdfs/ls.go +++ b/cmd/hdfs/ls.go @@ -47,8 +47,12 @@ func ls(paths []string, long, all bool) int { printFiles(nil, files, false, all) } - for _, dir := range dirs { - fmt.Printf("\n%s/:\n", dir) + for i, dir := range dirs { + if i > 0 { + fmt.Println() + } + + fmt.Printf("%s/:\n", dir) printDir(client, dir, long, all) } }