func GetRelease(uri string) (*GitHubReleasesLatest, error) {
	ctx, cancel := context.WithTimeout(context.Background(), timeout)
	defer cancel()
	req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil)
	if err != nil {
		return nil, fmt.Errorf("requesting github: %w", err)
	}
	resp, err := (&http.Client{}).Do(req)
	if err != nil {
		return nil, fmt.Errorf("querying github: %w", err)
	}
	defer resp.Body.Close()
	var release GitHubReleasesLatest
	if err = json.NewDecoder(resp.Body).Decode(&release); err != nil {
		return nil, fmt.Errorf("decoding github response: %w", err)
	}
	return &release, nil
}
GetRelease returns a GitHub release. See Check for an example on how to use it.
package update
import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"runtime"
	"strings"
	"time"
	"golang.org/x/mod/semver"
)
var OSsuffixMap = map[string]string{  
	"darwin":  ".dmg",
	"windows": ".exe.zip",
	"freebsd": ".txz",
	"linux":   "",  
}
const Latest = "https://api.github.com/repos/%s/releases/latest"
const timeout = 10 * time.Second
type Update struct {
	Outdate bool
	RelDate time.Time
	Version string
	Current string
	CurrURL string
}
func Check(userRepo string, version string) (*Update, error) {
	release, err := GetRelease(fmt.Sprintf(Latest, userRepo))
	if err != nil {
		return nil, err
	}
	return FillUpdate(release, version), nil
}