aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/git_tags.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/git_tags.go')
-rw-r--r--vendor/github.com/google/go-github/github/git_tags.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/github.com/google/go-github/github/git_tags.go b/vendor/github.com/google/go-github/github/git_tags.go
index a58858b..08df3d3 100644
--- a/vendor/github.com/google/go-github/github/git_tags.go
+++ b/vendor/github.com/google/go-github/github/git_tags.go
@@ -6,6 +6,7 @@
package github
import (
+ "context"
"fmt"
)
@@ -34,7 +35,7 @@ type createTagRequest struct {
// GetTag fetchs a tag from a repo given a SHA.
//
// GitHub API docs: https://developer.github.com/v3/git/tags/#get-a-tag
-func (s *GitService) GetTag(owner string, repo string, sha string) (*Tag, *Response, error) {
+func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -45,14 +46,14 @@ func (s *GitService) GetTag(owner string, repo string, sha string) (*Tag, *Respo
req.Header.Set("Accept", mediaTypeGitSigningPreview)
tag := new(Tag)
- resp, err := s.client.Do(req, tag)
+ resp, err := s.client.Do(ctx, req, tag)
return tag, resp, err
}
// CreateTag creates a tag object.
//
// GitHub API docs: https://developer.github.com/v3/git/tags/#create-a-tag-object
-func (s *GitService) CreateTag(owner string, repo string, tag *Tag) (*Tag, *Response, error) {
+func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo)
// convert Tag into a createTagRequest
@@ -72,6 +73,6 @@ func (s *GitService) CreateTag(owner string, repo string, tag *Tag) (*Tag, *Resp
}
t := new(Tag)
- resp, err := s.client.Do(req, t)
+ resp, err := s.client.Do(ctx, req, t)
return t, resp, err
}