Updates google/go-github to the latest revision (#12604)

* Updates to the latest go-github

* `github_repository_collaborator` uses invitations API
This commit is contained in:
Andy Lindeman
2017-03-12 10:05:18 -04:00
committed by Paul Stack
parent abe2f9ead1
commit 85f759f296
89 changed files with 13876 additions and 1694 deletions

View File

@@ -5,7 +5,10 @@
package github
import "fmt"
import (
"context"
"fmt"
)
// Blob represents a blob object.
type Blob struct {
@@ -18,8 +21,8 @@ type Blob struct {
// GetBlob fetchs a blob from a repo given a SHA.
//
// GitHub API docs: http://developer.github.com/v3/git/blobs/#get-a-blob
func (s *GitService) GetBlob(owner string, repo string, sha string) (*Blob, *Response, error) {
// GitHub API docs: https://developer.github.com/v3/git/blobs/#get-a-blob
func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -27,14 +30,14 @@ func (s *GitService) GetBlob(owner string, repo string, sha string) (*Blob, *Res
}
blob := new(Blob)
resp, err := s.client.Do(req, blob)
resp, err := s.client.Do(ctx, req, blob)
return blob, resp, err
}
// CreateBlob creates a blob object.
//
// GitHub API docs: https://developer.github.com/v3/git/blobs/#create-a-blob
func (s *GitService) CreateBlob(owner string, repo string, blob *Blob) (*Blob, *Response, error) {
func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo)
req, err := s.client.NewRequest("POST", u, blob)
if err != nil {
@@ -42,6 +45,6 @@ func (s *GitService) CreateBlob(owner string, repo string, blob *Blob) (*Blob, *
}
t := new(Blob)
resp, err := s.client.Do(req, t)
resp, err := s.client.Do(ctx, req, t)
return t, resp, err
}