if len(myPRs) != 0 && len(otherPRs) == 0 {
systray.AddMenuItem("No PRs from others, no news is good news.", "")
} else if len(otherPRs) != 0 {
- for _, pr := range myPRs {
+ for _, pr := range otherPRs {
var pr_status string
if pr.mergeable {
pr_status = "✅"
}
// Parse the form-encoded response
- fmt.Println("body", string(body))
parsedResponse, err := url.ParseQuery(string(body))
if err != nil {
errorOut("Github API error", err.Error())
return
}
- fmt.Println("user_code", user_code[0])
writeToClipboard(user_code[0])
zenity.Error("We just copied an authentication code in your clipboard. You will need to give that code to Github",
zenity.Title("Github Setup"),
continue
}
- fmt.Println("resp", resp)
if resp.StatusCode == 429 {
continue
} else if resp.StatusCode != 200 {
// Read the response body
body, err := ioutil.ReadAll(resp.Body)
- fmt.Println("body", string(body))
if err != nil {
errorOut("Error reading response body", err.Error())
continue
continue
}
- fmt.Println("parsedResponse", parsedResponse)
access_token, ok := parsedResponse["access_token"]
if !ok {
// sometimes the github API does not error but also does not return the access token.