pkg

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CalculateFileChecksum = calculateFileChecksum
View Source
var DownloadFile = downloadFile
View Source
var DownloadURLFormat = "https://dl.google.com/go/go%s.%s-%s.%s"
View Source
var GetOfficialChecksum = getOfficialChecksum
View Source
var NewProgressBar = progressbar.NewOptions64
View Source
var OsRemove = os.Remove
View Source
var RuntimeGOARCH = runtime.GOARCH
View Source
var RuntimeGOOS = runtime.GOOS
View Source
var URL = "https://go.dev/dl/?mode=json"
View Source
var VersionURL = "https://go.dev/VERSION?m=text"

Functions

func DownloadGo

func DownloadGo(version, targetOS, arch string) error

func ExtractGoVersion

func ExtractGoVersion(content string) string

func GetCurrentVersion

func GetCurrentVersion(filePath, directVersion string) (string, error)

func GetLatestVersion

func GetLatestVersion() (string, error)

func IsNewer

func IsNewer(latest, current string) bool

func ReadVersionFromFile

func ReadVersionFromFile(filePath string) (string, error)

Types

type GoRelease

type GoRelease struct {
	Version string `json:"version"`
	Stable  bool   `json:"stable"`
	Files   []struct {
		Filename string `json:"filename"`
		OS       string `json:"os"`
		Arch     string `json:"arch"`
		Version  string `json:"version"`
		SHA256   string `json:"sha256"`
	} `json:"files"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL