Skip to content

Commit

Permalink
check the unmarshal error
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Feb 22, 2022
1 parent f5f9936 commit 7f03239
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/yahoo.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func Quote(symbol string) QuoteStructure {

var quote QuoteResponse

json.Unmarshal(respData, &quote)
jsonErr := json.Unmarshal(respData, &quote)
if jsonErr != nil {
log.Fatal(jsonErr)
}

return quote.QuoteResponse.Result[0]
}
Expand Down

0 comments on commit 7f03239

Please sign in to comment.