From 358dac794ef528b33180efb86fc690b6892e73cd Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sat, 4 Nov 2017 10:28:09 +0100 Subject: [PATCH] Move parsedResponse struct definition up --- src/statusscreen/SL.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/statusscreen/SL.go b/src/statusscreen/SL.go index 58d8ed0..b21619d 100644 --- a/src/statusscreen/SL.go +++ b/src/statusscreen/SL.go @@ -70,6 +70,8 @@ func (sl *SL) GetOutput() string { } func (sl *SL) getTimeTable() SLResponse { + parsedResponse := SLResponse{} + // Construct URL with APIKey and Site url := fmt.Sprintf(sl.Config.SL.APIURL, sl.Config.SL.APIKey, sl.Config.SL.SiteID) @@ -91,7 +93,6 @@ func (sl *SL) getTimeTable() SLResponse { } // Parse response from SL - parsedResponse := SLResponse{} parseErr := json.Unmarshal(body, &parsedResponse) if parseErr != nil { log.Fatal(parseErr)