diff --git a/cmd/commit.go b/cmd/commit.go index 378afcc..6e5e2cf 100644 --- a/cmd/commit.go +++ b/cmd/commit.go @@ -132,7 +132,11 @@ func getCommitMessages(diff []byte, openAIAPIKey string) []string { body, _ := io.ReadAll(resp.Body) var result map[string]interface{} - json.Unmarshal(body, &result) + err = json.Unmarshal(body, &result) + if err != nil { + fmt.Println("Error parsing response:", err) + return nil + } choices, ok := result["choices"].([]interface{}) if !ok {