diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index d33ba62b7e..c9464e8f5b 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -168,14 +168,14 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { } } + repositories_detailed = make([]interface{}, 0, resultsPerPage) //removed this from the loop + for { repository, resp, err := client.Teams.ListTeamReposByID(ctx, orgId, team.GetID(), &options.ListOptions) if err != nil { return err } - repositories_detailed = make([]interface{}, 0, len(repository)) - for _, v := range repository { repositories = append(repositories, v.GetName()) repositories_detailed = append(repositories_detailed, map[string]interface{}{