Skip to content

Commit dc97200

Browse files
committed
Improve the comments of the github/repo.go
1 parent 244fd5d commit dc97200

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scm/driver/github/repo.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ func (s *repositoryService) FindPerms(ctx context.Context, repo string) (*scm.Pe
175175
return convertRepository(out).Perm, res, err
176176
}
177177

178-
// FindPerms returns the repository permissions.
179-
//
178+
// FindUserPermission returns the repository permissions.
180179
// https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level
181180
func (s *repositoryService) FindUserPermission(ctx context.Context, repo, user string) (string, *scm.Response, error) {
182181
path := fmt.Sprintf("repos/%s/collaborators/%s/permission", repo, user)
@@ -193,7 +192,7 @@ func (s *repositoryService) List(ctx context.Context, opts scm.ListOptions) ([]*
193192
Method: http.MethodGet,
194193
Path: fmt.Sprintf("user/repos?visibility=all&affiliation=owner&%s", encodeListOptions(opts)),
195194
Header: map[string][]string{
196-
// This accept header enables the visibility parameter.
195+
// This accepts header enables the visibility parameter.
197196
// https://developer.github.com/changes/2019-12-03-internal-visibility-changes/
198197
"Accept": {"application/vnd.github.nebula-preview+json"},
199198
},
@@ -203,15 +202,15 @@ func (s *repositoryService) List(ctx context.Context, opts scm.ListOptions) ([]*
203202
return convertRepositoryList(out), res, err
204203
}
205204

206-
// List returns the repositories for an organisation
205+
// ListOrganisation returns the repositories for an organisation
207206
func (s *repositoryService) ListOrganisation(ctx context.Context, org string, opts scm.ListOptions) ([]*scm.Repository, *scm.Response, error) {
208207
path := fmt.Sprintf("orgs/%s/repos?%s", org, encodeListOptions(opts))
209208
out := []*repository{}
210209
res, err := s.client.do(ctx, "GET", path, nil, &out)
211210
return convertRepositoryList(out), res, err
212211
}
213212

214-
// List returns the repositories for a user
213+
// ListUser returns the public repositories for the specified user
215214
func (s *repositoryService) ListUser(ctx context.Context, user string, opts scm.ListOptions) ([]*scm.Repository, *scm.Response, error) {
216215
path := fmt.Sprintf("users/%s/repos?%s", user, encodeListOptions(opts))
217216
out := []*repository{}

0 commit comments

Comments
 (0)