Move parsedResponse struct definition up
parent
af5786b04b
commit
358dac794e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue