issues

Github, Jira, Gitlab issues from Plan 9's acme
Log | Files | Refs | README | LICENSE

commit e9436d94846e746eee216cc1d7cac2d6d0fa077d
parent 6eda9b681078ee4c2502776abf46096ffedbeb90
Author: Russ Cox <rsc@golang.org>
Date:   Tue, 31 Jan 2017 09:17:37 -0500

github: fix for new API

Diffstat:
Missue/acme.go | 4++--
Missue/edit.go | 2+-
Missue/issue.go | 8++++----
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/issue/acme.go b/issue/acme.go @@ -166,10 +166,10 @@ var numRE = regexp.MustCompile(`(?m)^#[0-9]+\t`) var milecache struct { sync.Mutex - list []github.Milestone + list []*github.Milestone } -func cachedMilestones() []github.Milestone { +func cachedMilestones() []*github.Milestone { milecache.Lock() if milecache.list == nil { milecache.list, _ = loadMilestones() diff --git a/issue/edit.go b/issue/edit.go @@ -42,7 +42,7 @@ func editText(original []byte) []byte { if err != nil { log.Fatal(err) } - if err := ioutil.WriteFile(f.Name(), original, 0666); err != nil { + if err := ioutil.WriteFile(f.Name(), original, 0600); err != nil { log.Fatal(err) } if err := runEditor(f.Name()); err != nil { diff --git a/issue/issue.go b/issue/issue.go @@ -622,8 +622,8 @@ func listRepoIssues(opt github.IssueListByRepoOptions) ([]*github.Issue, error) } issues, resp, err := client.Issues.ListByRepo(projectOwner, projectRepo, &xopt) for i := range issues { - updateIssueCache(&issues[i]) - all = append(all, &issues[i]) + updateIssueCache(issues[i]) + all = append(all, issues[i]) } if err != nil { return all, err @@ -645,7 +645,7 @@ func listRepoIssues(opt github.IssueListByRepoOptions) ([]*github.Issue, error) return save, nil } -func loadMilestones() ([]github.Milestone, error) { +func loadMilestones() ([]*github.Milestone, error) { // NOTE(rsc): There appears to be no paging possible. all, _, err := client.Issues.ListMilestones(projectOwner, projectRepo, &github.MilestoneListOptions{ State: "open", @@ -654,7 +654,7 @@ func loadMilestones() ([]github.Milestone, error) { return nil, err } if all == nil { - all = []github.Milestone{} + all = []*github.Milestone{} } return all, nil }