func (w *workerQueue) enqueueCheck(org, repo, altpath, commitHash string, useSSH bool, pullID int, blame []string) {
	w.wg.Add(1)
	defer w.wg.Done()
	j := newJobRequest(org, repo, altpath, commitHash, useSSH, pullID, w.wd)
	if commitHash == "" && !j.findCommitHash() {
		log.Printf("- failed to get HEAD for issue #%d", pullID)
		return
	}
	log.Printf("- Enqueuing test for %s at %s", j.getID(), j.commitHash)
	gist := &github.Gist{
		Description: github.String(fmt.Sprintf("%s for %s", w.name, j)),
		Public: github.Bool(false),
		Files: map[github.GistFilename]github.GistFile{
			"setup-0-metadata": {Content: github.String(j.metadata())},
		},
	}
	gist, _, err := w.client.Gists.Create(w.ctx, gist)
	if err != nil {
		log.Printf("- Failed to create gist: %v", err)
		return
	}
	log.Printf("- Gist at %s", *gist.HTMLURL)
	status := &github.RepoStatus{
		State:       github.String("pending"),
		Description: github.String("Checks pending"),
		Context:     &w.name,
		TargetURL: gist.HTMLURL,
	}
	if !w.status(j, status) {
		return
	}
	w.wg.Add(1)
	go func() {
		defer w.wg.Done()
		w.runJobRequest(j, gist, status, blame)
	}()
}
enqueueCheck implements worker.
package main
import (
	"context"
	"fmt"
	"log"
	"strings"
	"sync"
	"time"
	"github.com/google/go-github/v31/github"
	"golang.org/x/oauth2"
	"periph.io/x/gohci"
)
type worker interface {
	enqueueCheck(org, repo, altpath, commitHash string, useSSH bool, pullID int, blame []string)
	wait()
}
type workerQueue struct {
	name   string  
	ctx    context.Context
	client *github.Client  
	wd     string
	mu sync.Mutex      
	wg sync.WaitGroup  
}
func newWorkerQueue(name, wd string, accessToken string) worker {
	tc := oauth2.NewClient(context.Background(), oauth2.StaticTokenSource(&oauth2.Token{AccessToken: accessToken}))
	return &workerQueue{
		name:   name,
		ctx:    context.Background(),
		client: github.NewClient(tc),
		wd:     wd,
	}
}