Skip to content

Commit b8beb99

Browse files
Merge pull request #314 from drone/ks/CODE-2043
fix unmarshalling array into Go value of type github.searchRepository…
2 parents 15e91da + 7f588f4 commit b8beb99

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scm/driver/github/repo.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ func (s *RepositoryService) ListV2(ctx context.Context, opts scm.RepoListOptions
122122
return convertRepositoryList(out.Repositories), res, err
123123
}
124124

125-
// ListNamespace returns the user repository list based on searchterm and namespace.
125+
// ListNamespace returns the orgs' repository list.
126126
func (s *RepositoryService) ListNamespace(ctx context.Context, namespace string, opts scm.ListOptions) ([]*scm.Repository, *scm.Response, error) {
127127
path := fmt.Sprintf("orgs/%s/repos?%s", namespace, encodeListOptions(opts))
128-
out := new(searchRepositoryList)
128+
out := []*repository{}
129129
res, err := s.client.do(ctx, "GET", path, nil, &out)
130-
return convertRepositoryList(out.Repositories), res, err
130+
return convertRepositoryList(out), res, err
131131
}
132132

133133
// List returns the github app installation repository list.
@@ -230,7 +230,7 @@ func (s *RepositoryService) DeleteHook(ctx context.Context, repo, id string) (*s
230230
return s.client.do(ctx, "DELETE", path, nil, nil)
231231
}
232232

233-
// helper function to convert from the gogs repository list to
233+
// helper function to convert from the github repository list to
234234
// the common repository structure.
235235
func convertRepositoryList(from []*repository) []*scm.Repository {
236236
to := []*scm.Repository{}
@@ -242,7 +242,7 @@ func convertRepositoryList(from []*repository) []*scm.Repository {
242242
return to
243243
}
244244

245-
// helper function to convert from the gogs repository structure
245+
// helper function to convert from the github repository structure
246246
// to the common repository structure.
247247
func convertRepository(from *repository) *scm.Repository {
248248
if from == nil {

0 commit comments

Comments
 (0)