Move parsedResponse struct definition up

master
Elis Hirwing 2017-11-04 10:28:09 +01:00
parent af5786b04b
commit 358dac794e
Signed by: etu
GPG Key ID: D57EFA625C9A925F
1 changed files with 2 additions and 1 deletions

View File

@ -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)