aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/gitignore.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/gitignore.go')
-rw-r--r--vendor/github.com/google/go-github/github/gitignore.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/vendor/github.com/google/go-github/github/gitignore.go b/vendor/github.com/google/go-github/github/gitignore.go
index 396178d..2f691bc 100644
--- a/vendor/github.com/google/go-github/github/gitignore.go
+++ b/vendor/github.com/google/go-github/github/gitignore.go
@@ -5,7 +5,10 @@
package github
-import "fmt"
+import (
+ "context"
+ "fmt"
+)
// GitignoresService provides access to the gitignore related functions in the
// GitHub API.
@@ -25,15 +28,15 @@ func (g Gitignore) String() string {
// List all available Gitignore templates.
//
-// https://developer.github.com/v3/gitignore/#listing-available-templates
-func (s GitignoresService) List() ([]string, *Response, error) {
+// GitHub API docs: https://developer.github.com/v3/gitignore/#listing-available-templates
+func (s GitignoresService) List(ctx context.Context) ([]string, *Response, error) {
req, err := s.client.NewRequest("GET", "gitignore/templates", nil)
if err != nil {
return nil, nil, err
}
var availableTemplates []string
- resp, err := s.client.Do(req, &availableTemplates)
+ resp, err := s.client.Do(ctx, req, &availableTemplates)
if err != nil {
return nil, resp, err
}
@@ -43,8 +46,8 @@ func (s GitignoresService) List() ([]string, *Response, error) {
// Get a Gitignore by name.
//
-// https://developer.github.com/v3/gitignore/#get-a-single-template
-func (s GitignoresService) Get(name string) (*Gitignore, *Response, error) {
+// GitHub API docs: https://developer.github.com/v3/gitignore/#get-a-single-template
+func (s GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) {
u := fmt.Sprintf("gitignore/templates/%v", name)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -52,7 +55,7 @@ func (s GitignoresService) Get(name string) (*Gitignore, *Response, error) {
}
gitignore := new(Gitignore)
- resp, err := s.client.Do(req, gitignore)
+ resp, err := s.client.Do(ctx, req, gitignore)
if err != nil {
return nil, resp, err
}