From 7b274c7e3ade26ba05519a1f5822a3084ccf88a9 Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sat, 4 Nov 2017 12:10:31 +0100 Subject: [PATCH] Split on newline before returning --- src/statusscreen/SL.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/statusscreen/SL.go b/src/statusscreen/SL.go index 9c10074..012e99c 100644 --- a/src/statusscreen/SL.go +++ b/src/statusscreen/SL.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "log" "net/http" + "strings" "time" ) @@ -42,7 +43,7 @@ type SLResponse struct { } // GetOutput returns a rendered result of this module -func (sl *SL) GetOutput() string { +func (sl *SL) GetOutput() []string { var b bytes.Buffer // Prepare table @@ -85,7 +86,7 @@ func (sl *SL) GetOutput() string { table.Render() - return b.String() + return strings.Split(b.String(), "\n") } func (sl *SL) getTimeTable() (SLResponse, error) {