From 165a48bc887c9f98fa4fedb168f1eb2904afea6c Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 22 May 2020 08:47:58 -0400 Subject: [PATCH 1/2] Export ArchiveFormat --- github/repos_contents.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index 015d9471a5e..e1a4d5cc04c 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -228,23 +228,23 @@ func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path return deleteResponse, resp, nil } -// archiveFormat is used to define the archive type when calling GetArchiveLink. -type archiveFormat string +// ArchiveFormat is used to define the archive type when calling GetArchiveLink. +type ArchiveFormat string const ( // Tarball specifies an archive in gzipped tar format. - Tarball archiveFormat = "tarball" + Tarball ArchiveFormat = "tarball" // Zipball specifies an archive in zip format. - Zipball archiveFormat = "zipball" + Zipball ArchiveFormat = "zipball" ) // GetArchiveLink returns an URL to download a tarball or zipball archive for a -// repository. The archiveFormat can be specified by either the github.Tarball +// repository. The ArchiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // // GitHub API docs: https://developer.github.com/v3/repos/contents/#get-archive-link -func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat archiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { +func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { u += fmt.Sprintf("/%s", opts.Ref) From aa151752c8b656cdee7b4dafc925256c4209e1dd Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 22 May 2020 08:50:53 -0400 Subject: [PATCH 2/2] Comment tweak --- github/repos_contents.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index e1a4d5cc04c..02d45a12ce0 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -240,7 +240,7 @@ const ( ) // GetArchiveLink returns an URL to download a tarball or zipball archive for a -// repository. The ArchiveFormat can be specified by either the github.Tarball +// repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // // GitHub API docs: https://developer.github.com/v3/repos/contents/#get-archive-link