You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: github.go
    path of file: ./repos/devdash/internal/platform
    
    the code of the file until where you have to start completion: // To get fixtures in order to write tests
// j, _ := json.Marshal(is)
// fmt.Println(string(j))

package platform

import (
	"context"
	"sort"
	"strconv"
	"sync"
	"time"

	"github.com/google/go-github/v28/github"
	"github.com/pkg/errors"
	"golang.org/x/oauth2"
	"golang.org/x/sync/errgroup"
)

const (
	githubRepoStars      = "stars"
	githubRepoWatchers   = "watchers"
	githubRepoForks      = "forks"
	githubRepoOpenIssues = "open_issues"

	githubScopeOwner = "owner"
	githubScopeAll   = "all"

	githubMaxPerPage = 100
)

// Github structure connects to the Github API.
type Github st
    
func (g *Github) fetchStars(repository string) (s []*github.Stargazer, err error) {
	repo := g.repoName
	if repository != "" {
		repo = repository
	}

	if repo == "" {
		return nil, errors.New("you need to specify a repository in the github service or in the widget")
	}

	r, err := g.fetchRepo(repository)
	if err != nil {
		return nil, err
	}

	pages := (*r.StargazersCount / githubMaxPerPage)
	if *r.StargazersCount%100 != 0 {
		pages += 1
	}

	var lock sync.Mutex
	var eg errgroup.Group
	sem := make(chan bool, 4)

	// TODO See if it can be improved
	for i := 1; i <= pages; i++ {
		sem <- true
		page := i
		eg.Go(func() error {
			defer func() { <-sem }()
			e, _, err := g.client.Activity.ListStargazers(context.Background(), g.owner, repo, &github.ListOptions{
				Page:    page,
				PerPage: githubMaxPerPage,
			})
			if err != nil {
				return errors.Wrapf(err, "can't find repo %s of owner %s", repo, g.owner)
			}

			lock.Lock()
			defer lock.Unlock()
			s = append(s, e...)
			return nil
		})
	}
	err = eg.Wait()
	if err != nil {
		return nil, err
	}

	return s, nil
}