func measureGitHubV3RateLimit() {
	for {
		rate, _, err := dmitshurPublicRepoGHV3.RateLimits(context.Background())
		if err != nil {
			log.Println("dmitshurPublicRepoGHV3.RateLimits:", err)
			time.Sleep(time.Minute)
			continue
		}
		metrics.SetGitHubRateLimit("dmitshur-v3", rate.Core.Remaining)
		time.Sleep(time.Minute)
	}
}
measureGitHubV3RateLimit measures and reports GitHub API v3 rate limit.
package main
import (
	"context"
	"errors"
	"fmt"
	"log"
	"net/http"
	"os"
	"strings"
	"time"
	githubv3 "github.com/google/go-github/github"
	"github.com/gregjones/httpcache"
	"github.com/shurcooL/githubv4"
	"github.com/shurcooL/home/internal/exp/service/user/fs"
	"github.com/shurcooL/users"
	"golang.org/x/net/webdav"
	"golang.org/x/oauth2"
)
var dmitshur = users.UserSpec{ID: 1924134, Domain: "github.com"}
var dmitshurPublicRepoGHV3, dmitshurPublicRepoGHV4 = func() (*githubv3.Client, *githubv4.Client) {
	authTransport := &oauth2.Transport{
		Source: oauth2.StaticTokenSource(&oauth2.Token{AccessToken: os.Getenv("HOME_GH_DMITSHUR_PUBLIC_REPO")}),
	}
	cacheTransport := &httpcache.Transport{
		Transport:           authTransport,
		Cache:               httpcache.NewMemoryCache(),
		MarkCachedResponses: true,
	}
	return githubv3.NewClient(&http.Client{Transport: cacheTransport, Timeout: 10 * time.Second}),
		githubv4.NewClient(&http.Client{Transport: authTransport, Timeout: 10 * time.Second})
}()