Commit 932efea
Changed files (1)
command.go
@@ -157,10 +157,10 @@ func displayTest(clientTest ClientTest) {
// from the server
func getScoreFromServer(command Command) error {
resp, err := client.Get(clientConfig.SERVER_URL + API_ROOT + "/test/score?username=" + clientConfig.USER)
- defer resp.Body.Close()
if err != nil {
return fmt.Errorf("Error while making request: %+v", err)
}
+ defer resp.Body.Close()
clientTests := []ClientTest{}
decoder := json.NewDecoder(resp.Body)
err = decoder.Decode(&clientTests)