dmitri.shuralyov.com/service/change/githubapi

Avoid using embedded pointer to unexported struct.

It can't be set in Go 1.10 due to reflect changes.

Also switch from githubqlActor to githubqlUser because RequestedReviewer
union is known to be User or Team, so Actor interface is unnecessarily
broad.

References:

-	https://tip.golang.org/doc/go1.10#reflect
-	https://developer.github.com/v4/union/requestedreviewer/
-	https://developer.github.com/v4/interface/actor/
dmitshur committed 6 years ago commit 8371dbf1bbdfedfb1249989c3e0b277143ede61a
Showing partial commit. Full Commit
Collapse all
githubapi/githubapi.go
@@ -311,17 +311,17 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch
							}
						} `graphql:"...on UnlabeledEvent"`
						ReviewRequestedEvent struct {
							event
							RequestedReviewer struct {
								*githubqlActor `graphql:"...on Actor"`
								User *githubqlUser `graphql:"...on User"`
							}
						} `graphql:"...on ReviewRequestedEvent"`
						ReviewRequestRemovedEvent struct {
							event
							RequestedReviewer struct {
								*githubqlActor `graphql:"...on Actor"`
								User *githubqlUser `graphql:"...on User"`
							}
						} `graphql:"...on ReviewRequestRemovedEvent"`
						MergedEvent struct {
							event
							Commit struct {
@@ -489,17 +489,17 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch
			}
		case "ReviewRequestedEvent":
			e.Actor = ghActor(event.ReviewRequestedEvent.Actor)
			e.CreatedAt = event.ReviewRequestedEvent.CreatedAt.Time
			e.Payload = change.ReviewRequestedEvent{
				RequestedReviewer: ghActor(event.ReviewRequestedEvent.RequestedReviewer.githubqlActor),
				RequestedReviewer: ghUser(event.ReviewRequestedEvent.RequestedReviewer.User),
			}
		case "ReviewRequestRemovedEvent":
			e.Actor = ghActor(event.ReviewRequestRemovedEvent.Actor)
			e.CreatedAt = event.ReviewRequestRemovedEvent.CreatedAt.Time
			e.Payload = change.ReviewRequestRemovedEvent{
				RequestedReviewer: ghActor(event.ReviewRequestRemovedEvent.RequestedReviewer.githubqlActor),
				RequestedReviewer: ghUser(event.ReviewRequestRemovedEvent.RequestedReviewer.User),
			}
		case "MergedEvent":
			e.Actor = ghActor(event.MergedEvent.Actor)
			e.CreatedAt = event.MergedEvent.CreatedAt.Time
			e.Payload = change.MergedEvent{