Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5.  
  6. "github.com/google/go-github/github"
  7. )
  8.  
  9. func main() {
  10. client := github.NewClient(nil)
  11. owner := "google"
  12. repo := "go-github"
  13.  
  14. // Pulls attributes frmo Repositories.go
  15. /* opt := &github.RepositoryListOptions{Type: "public"}
  16. repos, _, err := client.Repositories.List(owner, opt)
  17. if err != nil {
  18. fmt.Println(err)
  19. return
  20. }
  21.  
  22. //fmt.Printf("repos is a %T", repos)
  23. fmt.Println(repos[0].FullName)
  24. */
  25.  
  26. // pulls attributes from PullRequests.go
  27. pullreq, _, err := client.PullRequests.List(owner, repo, nil)
  28. if err != nil {
  29. fmt.Println(err)
  30. return
  31. }
  32.  
  33. fmt.Println(pullreq[0].User.Login)
  34. fmt.Println(pullreq[0].State)
  35. fmt.Println(pullreq[0].CreatedAt)
  36. fmt.Println(pullreq[0].UpdatedAt)
  37. fmt.Println(pullreq[0].ClosedAt)
  38. fmt.Println(pullreq[0].MergedAt)
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement