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: stale_repositories_test.go
    path of file: ./repos/awesome-go
    
    the code of the file until where you have to start completion: package main

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"regexp"
	"strings"
	"testing"
	"text/template"
	"time"

	"github.com/PuerkitoBio/goquery"
	"golang.org/x/oauth2"
)

const issueTemplateContent = `
{{range .}}
- [ ] {{.}}
{{end}}
`

var issueTemplate = template.Must(template.New("issue").Parse(issueTemplateContent))

// FIXME: use official github client
var reGithubRepo = regexp.MustCompile("https://github.com/[a-zA-Z0-9-._]+/[a-zA-Z0-9-._]+$")
var githubGETREPO = "https://api.github.com/repos%s"
var githubGETCOMMITS = "https://api.github.com/repos%s/commits"
var githubPOSTISSUES = "https://api.github.com/repos/avelino/awesome-go/issues"

// FIXME: use https
var awesomeGoGETISSUES = "http://api.github.com/repos/avelino/awesome-go/issues" //only returns open issues
// FIXME: variable has type Duration, but contains a number. we should use
//
//	time.Hour * ... or cha
    
func checkRepoAvailability(toRun bool, href string, client *http.Client) ([]string, bool) {
	if !toRun {
		return nil, false
	}

	ownerRepo := strings.ReplaceAll(href, "https://github.com", "")
	apiCall := fmt.Sprintf(githubGETREPO, ownerRepo)
	req, err := http.NewRequest(http.MethodGet, apiCall, nil)
	if err != nil {
		log.Printf("Failed at repository %s\n", href)
		return nil, false
	}

	resp, err := client.Do(req)
	if err != nil {
		log.Printf("Failed at repository %s\n", href)
		return nil, false
	}

	defer resp.Body.Close()

	var repoResp struct {
		Archived bool `json:"archived"`
	}

	if err := json.NewDecoder(resp.Body).Decode(&repoResp); err != nil {
		return nil, false
	}

	var isRepoAdded bool

	var warnings []string
	if resp.StatusCode == http.StatusMovedPermanently {
		warnings = append(warnings, href+movedPermanently)
		log.Printf("%s returned %d", href, resp.StatusCode)
		isRepoAdded = true
	}

	if resp.StatusCode == http.StatusFound && !isRepoAdded {
		warnings = append(warnings, href+status302)
		log.Printf("%s returned %d", href, resp.StatusCode)
		isRepoAdded = true
	}

	if resp.StatusCode >= http.StatusBadRequest && !isRepoAdded {
		warnings = append(warnings, href+deadLinkMessage)
		log.Printf("%s might not exist!", href)
		isRepoAdded = true
	}

	if repoResp.Archived && !isRepoAdded {
		warnings = append(warnings, href+archived)
		log.Printf("%s is archived!", href)
		isRepoAdded = true
	}

	// FIXME: expression `(len(warnings) > 0) == isRepoAdded` is always true.
	return warnings, isRepoAdded
}