Skip to content

Commit

Permalink
Merge pull request #314 from drone/ks/CODE-2043
Browse files Browse the repository at this point in the history
fix unmarshalling array into Go value of type github.searchRepository…
  • Loading branch information
karansaraswat19 authored Jun 25, 2024
2 parents 15e91da + 7f588f4 commit b8beb99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scm/driver/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ func (s *RepositoryService) ListV2(ctx context.Context, opts scm.RepoListOptions
return convertRepositoryList(out.Repositories), res, err
}

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

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

// helper function to convert from the gogs repository list to
// helper function to convert from the github repository list to
// the common repository structure.
func convertRepositoryList(from []*repository) []*scm.Repository {
to := []*scm.Repository{}
Expand All @@ -242,7 +242,7 @@ func convertRepositoryList(from []*repository) []*scm.Repository {
return to
}

// helper function to convert from the gogs repository structure
// helper function to convert from the github repository structure
// to the common repository structure.
func convertRepository(from *repository) *scm.Repository {
if from == nil {
Expand Down

0 comments on commit b8beb99

Please sign in to comment.