From eec1cbc26f3aedccc4e4d520f8cbdab46e099223 Mon Sep 17 00:00:00 2001 From: Greg Wedow Date: Sun, 21 Aug 2016 10:48:42 -0400 Subject: [PATCH] format /uptime output with go-humanize --- host.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/host.go b/host.go index 631375b..472f3d7 100644 --- a/host.go +++ b/host.go @@ -8,6 +8,7 @@ import ( "sync" "time" + "github.com/dustin/go-humanize" "github.com/shazow/rateio" "github.com/shazow/ssh-chat/chat" "github.com/shazow/ssh-chat/chat/message" @@ -365,7 +366,7 @@ func (h *Host) InitCommands(c *chat.Commands) { c.Add(chat.Command{ Prefix: "/uptime", Handler: func(room *chat.Room, msg message.CommandMsg) error { - room.Send(message.NewSystemMsg(time.Now().Sub(timeStarted).String(), msg.From())) + room.Send(message.NewSystemMsg(humanize.Time(timeStarted), msg.From())) return nil }, })