version

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSdkDir               = "~/go/sdk"
	DefaultCacheDir             = "~/.gvm/cache"
	DefaultOriginURL            = "https://go.dev/dl/?mode=json&include=all"
	DefaultDownloadURL          = "https://dl.google.com/go/"
	DefaultVersionFilePath      = "~/.gvm/versions.json"
	DefaultLocalVersionFilePath = "~/.gvm/version"
)

Variables

This section is empty.

Functions

func FetchLocalVersions

func FetchLocalVersions(sdkDir string) ([]string, error)

func Install

func Install(cacheFilePath, sdkFilePath, downloadFileUrl string) error

func Uninstall

func Uninstall(version, sdkFilePath string) error

func Use

func Use(version, sdkDir, localVersionFilePath string, isEval bool) error

Types

type File

type File struct {
	Filename string `json:"filename"`
	OS       string `json:"os"`
	Arch     string `json:"arch"`
	Version  string `json:"version"`
	SHA256   string `json:"sha256"`
	Size     int    `json:"size"`
	Kind     string `json:"kind"`
}

type OriginVersion

type OriginVersion struct {
	Version string `json:"version"`
	Stable  bool   `json:"stable"`
	Files   []File `json:"files"`
}

func FetchOriginVersions

func FetchOriginVersions(originURL, versionFilePath string, forceUpdate bool) ([]OriginVersion, error)

type Version

type Version struct {
	// contains filtered or unexported fields
}

func NewVersion

func NewVersion(opts ...VersionOption) *Version

func (*Version) Install

func (v *Version) Install(targetVersion string, isForce bool)

func (*Version) List

func (v *Version) List(isLatest bool, showNumber int, forceUpdate bool)

func (*Version) Ls

func (v *Version) Ls()

func (*Version) Uninstall

func (v *Version) Uninstall(targetVersion string)

func (*Version) Use

func (v *Version) Use(targetVersion string, isForce, isEval bool)

type VersionOption

type VersionOption func(*Version)

func WithCacheDir

func WithCacheDir(cacheDir string) VersionOption

func WithDownloadURL

func WithDownloadURL(downloadURL string) VersionOption

func WithOriginURL

func WithOriginURL(originURL string) VersionOption

func WithSdkDir

func WithSdkDir(sdkDir string) VersionOption

Jump to

Keyboard shortcuts

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