Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "github.com/google/go-github/github"
- )
- func main() {
- client := github.NewClient(nil)
- owner := "google"
- repo := "go-github"
- // Pulls attributes frmo Repositories.go
- /* opt := &github.RepositoryListOptions{Type: "public"}
- repos, _, err := client.Repositories.List(owner, opt)
- if err != nil {
- fmt.Println(err)
- return
- }
- //fmt.Printf("repos is a %T", repos)
- fmt.Println(repos[0].FullName)
- */
- // pulls attributes from PullRequests.go
- pullreq, _, err := client.PullRequests.List(owner, repo, nil)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Println(pullreq[0].User.Login)
- fmt.Println(pullreq[0].State)
- fmt.Println(pullreq[0].CreatedAt)
- fmt.Println(pullreq[0].UpdatedAt)
- fmt.Println(pullreq[0].ClosedAt)
- fmt.Println(pullreq[0].MergedAt)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement