Commit Diff


commit - 35a2038f0578687a6894b44e992d1d3ecdc92575
commit + f5e2c5fe5d55e3364885c24178b3d9b030e2d63a
blob - edb8683857f395ab16b08df3c79853cfcfec8f2e
blob + 7da863e7487a9fe0772113a40f58f855fbe61b70
--- go.mod
+++ go.mod
@@ -1,14 +1,18 @@
 module rsc.io/github
 
-go 1.22.0
+go 1.21
 
+toolchain go1.22.1
+
 require (
 	9fans.net/go v0.0.7
-	github.com/google/go-github v17.0.0+incompatible
+	github.com/google/go-github/v63 v63.0.0
 	golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
 )
 
 require (
-	github.com/google/go-cmp v0.6.0 // indirect
+	github.com/golang/protobuf v1.2.0 // indirect
 	github.com/google/go-querystring v1.1.0 // indirect
+	golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
+	google.golang.org/appengine v1.4.0 // indirect
 )
blob - 0461a2f8975819b1bf7290595de5b782fc956f4c
blob + 46a5c8c5a607ee8a519709e1b502b889f36c2729
--- go.sum
+++ go.sum
@@ -3,11 +3,21 @@
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
+<<<<<<< HEAD
 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
 github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
 github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
+=======
+github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE=
+github.com/google/go-github/v63 v63.0.0/go.mod h1:IqbcrgUmIcEaioWrGYei/09o+ge5vhffGOcxrO0AfmA=
+>>>>>>> 1d69c70 (issue: upgrade to github.com/google/go-github/v63)
 github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
 github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -41,5 +51,6 @@ golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/
 golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
blob - e00872c2d9c802f584367ab11aca997131752cce
blob + fa156c3c514954664de22413b7eb08441ac19a1e
--- issue/acme.go
+++ issue/acme.go
@@ -23,7 +23,7 @@ import (
 
 	"9fans.net/go/acme"
 	"9fans.net/go/plumb"
-	"github.com/google/go-github/v62/github"
+	"github.com/google/go-github/v63/github"
 )
 
 const root = "/issue/"
@@ -420,7 +420,7 @@ func (w *awin) load() {
 		}
 		var buf bytes.Buffer
 		for _, m := range milestones {
-			fmt.Fprintf(&buf, "%s\t%s\t%d\n", getTime(m.DueOn).Format("2006-01-02"), getString(m.Title), getInt(m.OpenIssues))
+			fmt.Fprintf(&buf, "%s\t%s\t%d\n", m.DueOn.Format("2006-01-02"), getString(m.Title), getInt(m.OpenIssues))
 		}
 		w.PrintTabbed(buf.String())
 		w.Ctl("clean")
blob - feec9d41771d7dae78f4cd4ded8cea39780ac0dc
blob + 9b5a4f67b3590cb179e1d122740d82733e2a2e0a
--- issue/edit.go
+++ issue/edit.go
@@ -17,7 +17,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/google/go-github/v62/github"
+	"github.com/google/go-github/v63/github"
 )
 
 func editIssue(project string, original []byte, issue *github.Issue) {
blob - 01d5441c41a0a9eab76ec57c34ef305b14b7ce3c
blob + feffb8efc4b20a147e18afaf533b7f4503623cd7
--- issue/issue.go
+++ issue/issue.go
@@ -264,7 +264,7 @@ import (
 	"sync"
 	"time"
 
-	"github.com/google/go-github/v62/github"
+	"github.com/google/go-github/v63/github"
 	"golang.org/x/oauth2"
 )
 
@@ -389,13 +389,19 @@ func printIssue(w io.Writer, project string, issue *gi
 	fmt.Fprintf(w, "State: %s\n", getString(issue.State))
 	fmt.Fprintf(w, "Assignee: %s\n", getUserLogin(issue.Assignee))
 	if issue.ClosedAt != nil {
-		fmt.Fprintf(w, "Closed: %s\n", getTime(issue.ClosedAt).Format(timeFormat))
+		fmt.Fprintf(w, "Closed: %s\n", issue.ClosedAt.Format(timeFormat))
 	}
 	fmt.Fprintf(w, "Labels: %s\n", strings.Join(getLabelNames(issue.Labels), " "))
 	fmt.Fprintf(w, "Milestone: %s\n", getMilestoneTitle(issue.Milestone))
+<<<<<<< HEAD
 	fmt.Fprintf(w, "URL: %s\n", getString(issue.HTMLURL))
 	fmt.Fprintf(w, "Reactions: %v\n", getReactions(issue.Reactions))
 	fmt.Fprintf(w, "\nReported by %s (%s)\n", getUserLogin(issue.User), getTime(issue.CreatedAt).Format(timeFormat))
+=======
+	fmt.Fprintf(w, "URL: https://github.com/%s/%s/issues/%d\n", projectOwner(project), projectRepo(project), getInt(issue.Number))
+
+	fmt.Fprintf(w, "\nReported by %s (%s)\n", getUserLogin(issue.User), issue.CreatedAt.Format(timeFormat))
+>>>>>>> 1d69c70 (issue: upgrade to github.com/google/go-github/v63)
 	if issue.Body != nil {
 		if *rawFlag {
 			fmt.Fprintf(w, "\n%s\n\n", *issue.Body)
@@ -419,8 +425,8 @@ func printIssue(w io.Writer, project string, issue *gi
 		for _, com := range list {
 			var buf bytes.Buffer
 			w := &buf
-			fmt.Fprintf(w, "%s\n", getTime(com.CreatedAt).Format(time.RFC3339))
-			fmt.Fprintf(w, "\nComment by %s (%s)\n", getUserLogin(com.User), getTime(com.CreatedAt).Format(timeFormat))
+			fmt.Fprintf(w, "%s\n", com.CreatedAt.Format(time.RFC3339))
+			fmt.Fprintf(w, "\nComment by %s (%s)\n", getUserLogin(com.User), com.CreatedAt.Format(timeFormat))
 			if com.Body != nil {
 				if *rawFlag {
 					fmt.Fprintf(w, "\n%s\n\n", *com.Body)
@@ -454,12 +460,12 @@ func printIssue(w io.Writer, project string, issue *gi
 		for _, ev := range list {
 			var buf bytes.Buffer
 			w := &buf
-			fmt.Fprintf(w, "%s\n", getTime(ev.CreatedAt).Format(time.RFC3339))
+			fmt.Fprintf(w, "%s\n", ev.CreatedAt.Format(time.RFC3339))
 			switch event := getString(ev.Event); event {
 			case "mentioned", "subscribed", "unsubscribed":
 				// ignore
 			default:
-				fmt.Fprintf(w, "\n* %s %s (%s)\n", getUserLogin(ev.Actor), event, getTime(ev.CreatedAt).Format(timeFormat))
+				fmt.Fprintf(w, "\n* %s %s (%s)\n", getUserLogin(ev.Actor), event, ev.CreatedAt.Format(timeFormat))
 			case "closed", "referenced", "merged":
 				id := getString(ev.CommitID)
 				if id != "" {
@@ -468,29 +474,29 @@ func printIssue(w io.Writer, project string, issue *gi
 					}
 					id = " in commit " + id
 				}
-				fmt.Fprintf(w, "\n* %s %s%s (%s)\n", getUserLogin(ev.Actor), event, id, getTime(ev.CreatedAt).Format(timeFormat))
+				fmt.Fprintf(w, "\n* %s %s%s (%s)\n", getUserLogin(ev.Actor), event, id, ev.CreatedAt.Format(timeFormat))
 				if id != "" {
 					commit, _, err := client.Git.GetCommit(context.TODO(), projectOwner(project), projectRepo(project), *ev.CommitID)
 					if err == nil {
 						fmt.Fprintf(w, "\n\tAuthor: %s <%s> %s\n\tCommitter: %s <%s> %s\n\n\t%s\n",
-							getString(commit.Author.Name), getString(commit.Author.Email), getTime(commit.Author.Date).Format(timeFormat),
-							getString(commit.Committer.Name), getString(commit.Committer.Email), getTime(commit.Committer.Date).Format(timeFormat),
+							getString(commit.Author.Name), getString(commit.Author.Email), commit.Author.Date.Format(timeFormat),
+							getString(commit.Committer.Name), getString(commit.Committer.Email), commit.Committer.Date.Format(timeFormat),
 							wrap(getString(commit.Message), "\t"))
 					}
 				}
 			case "assigned", "unassigned":
-				fmt.Fprintf(w, "\n* %s %s %s (%s)\n", getUserLogin(ev.Actor), event, getUserLogin(ev.Assignee), getTime(ev.CreatedAt).Format(timeFormat))
+				fmt.Fprintf(w, "\n* %s %s %s (%s)\n", getUserLogin(ev.Actor), event, getUserLogin(ev.Assignee), ev.CreatedAt.Format(timeFormat))
 			case "labeled", "unlabeled":
-				fmt.Fprintf(w, "\n* %s %s %s (%s)\n", getUserLogin(ev.Actor), event, getString(ev.Label.Name), getTime(ev.CreatedAt).Format(timeFormat))
+				fmt.Fprintf(w, "\n* %s %s %s (%s)\n", getUserLogin(ev.Actor), event, getString(ev.Label.Name), ev.CreatedAt.Format(timeFormat))
 			case "milestoned", "demilestoned":
 				if event == "milestoned" {
 					event = "added to milestone"
 				} else {
 					event = "removed from milestone"
 				}
-				fmt.Fprintf(w, "\n* %s %s %s (%s)\n", getUserLogin(ev.Actor), event, getString(ev.Milestone.Title), getTime(ev.CreatedAt).Format(timeFormat))
+				fmt.Fprintf(w, "\n* %s %s %s (%s)\n", getUserLogin(ev.Actor), event, getString(ev.Milestone.Title), ev.CreatedAt.Format(timeFormat))
 			case "renamed":
-				fmt.Fprintf(w, "\n* %s changed title (%s)\n  - %s\n  + %s\n", getUserLogin(ev.Actor), getTime(ev.CreatedAt).Format(timeFormat), getString(ev.Rename.From), getString(ev.Rename.To))
+				fmt.Fprintf(w, "\n* %s changed title (%s)\n  - %s\n  + %s\n", getUserLogin(ev.Actor), ev.CreatedAt.Format(timeFormat), getString(ev.Rename.From), getString(ev.Rename.To))
 			}
 			output = append(output, buf.String())
 		}
@@ -769,6 +775,7 @@ func getUserLogin(x *github.User) string {
 	return *x.Login
 }
 
+<<<<<<< HEAD
 func getTime(x *github.Timestamp) time.Time {
 	if x == nil {
 		return time.Time{}
@@ -776,6 +783,8 @@ func getTime(x *github.Timestamp) time.Time {
 	return x.Local()
 }
 
+=======
+>>>>>>> 1d69c70 (issue: upgrade to github.com/google/go-github/v63)
 func getMilestoneTitle(x *github.Milestone) string {
 	if x == nil || x.Title == nil {
 		return ""
@@ -909,12 +918,12 @@ func toJSON(project string, issue *github.Issue) *Issu
 		Title:     getString(issue.Title),
 		State:     getString(issue.State),
 		Assignee:  getUserLogin(issue.Assignee),
-		Closed:    getTime(issue.ClosedAt),
+		Closed:    issue.ClosedAt.Time,
 		Labels:    getLabelNames(issue.Labels),
 		Milestone: getMilestoneTitle(issue.Milestone),
 		URL:       fmt.Sprintf("https://github.com/%s/%s/issues/%d\n", projectOwner(project), projectRepo(project), getInt(issue.Number)),
 		Reporter:  getUserLogin(issue.User),
-		Created:   getTime(issue.CreatedAt),
+		Created:   issue.CreatedAt.Time,
 		Text:      getString(issue.Body),
 		Comments:  []*Comment{},
 		Reactions: getReactions(issue.Reactions),
@@ -939,10 +948,16 @@ func toJSONWithComments(project string, issue *github.
 		}
 		for _, com := range list {
 			j.Comments = append(j.Comments, &Comment{
+<<<<<<< HEAD
 				Author:    getUserLogin(com.User),
 				Time:      getTime(com.CreatedAt),
 				Text:      getString(com.Body),
 				Reactions: getReactions(com.Reactions),
+=======
+				Author: getUserLogin(com.User),
+				Time:   com.CreatedAt.Time,
+				Text:   getString(com.Body),
+>>>>>>> 1d69c70 (issue: upgrade to github.com/google/go-github/v63)
 			})
 		}
 		if resp.NextPage < page {