goinstalls

package
v0.0.0-...-ced39b3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const GODLURL = "https://storage.googleapis.com/golang/"

GODLURL is the url from which golang src tars can be dowloaded.

Variables

This section is empty.

Functions

func InstallVersion

func InstallVersion(v Version, src, targetPath, goroot string) error

InstallVersion downloads, extracts and installs the given go version.

func OnlineAvailableVersions

func OnlineAvailableVersions() (map[Version]string, error)

OnlineAvailableVersions returns a map of all found versions grouped by Minor number and with the latest patch of said Minor as value.

Types

type Version

type Version struct {
	// Major is the first tier of a version number.
	Major int
	// Minor is the second tier of a version number.
	Minor int
	// Patch is the final tier of a version number.
	Patch int
}

Version represents a go version, since its intended for the source of released versions, no suffix/build is supported. TODO (perrito666) accept build/rc and figure how to determine newer.

func InstalledAvailableVersions

func InstalledAvailableVersions() []Version

InstalledAvailableVersions returns a slice of the Versions that have a current install locally.

func NewestAvailableOnline

func NewestAvailableOnline() (Version, string, error)

NewestAvailableOnline returns the newest version available to download.

func VersionFromString

func VersionFromString(versionStr string) (Version, error)

VersionFromString returns a Version created from a valid string version of the form x.y.z or x.y

func (Version) CommonVersionString

func (v Version) CommonVersionString() string

CommonVersionString returns a string representing the Major.Minor version of the version.

func (Version) IsNewerThan

func (v Version) IsNewerThan(ver Version) bool

IsNewerThan returns true if the passed version is older than the current one.

func (Version) SameVersion

func (v Version) SameVersion(ver Version) bool

SameVersion returns true if the passed version is of the same root than the current one, ie: 1.7.2 and 1.7.3.

func (Version) String

func (v Version) String() string

String returns the string representation of this Version.

Jump to

Keyboard shortcuts

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