From 71b34e43474ed0ae194f51df1983078d28d50d03 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 8 Jun 2015 02:17:22 -0700 Subject: [PATCH] Add some comments in ls.go --- ls.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ls.go b/ls.go index e1eeebc8..4673bc8b 100644 --- a/ls.go +++ b/ls.go @@ -38,13 +38,18 @@ const ( func parseContent(c *client.Content) Content { content := Content{} content.Time = c.Time.Local().Format(printDate) + + // guess file type content.Filetype = func() string { if c.Type.IsDir() { return "inode/directory" } return "application/octet-stream" }() + content.Size = humanize.IBytes(uint64(c.Size)) + + // Convert OS Type to match console file printing style content.Name = func() string { switch { case runtime.GOOS == "windows":