Documentation ¶
Index ¶
- Constants
- func CheckInstalled(goenvInstallDirectory string, version string) error
- func CheckLatestGo() error
- func CheckLatestGoenv(ctx context.Context, currentVersion *semver.Version) error
- func CheckRW(goenvRootDirectory string, goenvInstallDirectory string) []string
- func CreateGoVersionList(directories []string) map[string][]string
- func Debug(mesg string)
- func DownloadFile(v *semver.Version) (filepath string, err error)
- func Error(mesg string)
- func ExtractTarGz(tarballPath, destinationPath string) error
- func Info(mesg string)
- func ListAvailableVersions(getAllVersions bool) ([]string, error)
- func Print(g map[string][]string, linePrefix string)
- func Success(mesg string)
- func Warn(mesg string)
- type ChecksumSHA256
- type File
- type Release
Constants ¶
const HttpRequestTimeout = 30
Variables ¶
This section is empty.
Functions ¶
func CheckInstalled ¶ added in v0.2.0
CheckInstalled simply checks if a directory exists.
func CheckLatestGo ¶ added in v0.1.2
func CheckLatestGo() error
CheckLatestGo looks for new stable versions of Go. If new stable versions have been released since the last check, then we'll let the user know. We only print this message once per new set of releases.
func CheckLatestGoenv ¶ added in v0.1.2
CheckLatestGoenv checks the Github releases for a new version of Goenv. If one is found, the one-line install instructions are printed to the console.
func CheckRW ¶
CheckRW checks if the user can install and use Go by making sure they have read and write access to the directories where go will be installed.
func CreateGoVersionList ¶ added in v0.0.4
CreateGoVersionList will take a list of all the directories in goenv and then parse it into a GoVersionList. We do this so that we can print the installed Go versions nicely for the user.
func DownloadFile ¶
DownloadFile will download a url to a local file. If we have a recorded shasum for the file, we'll check it. We'll return a path to the downloaded file. https://go.dev/dl/go1.18.linux-amd64.tar.gz
func ExtractTarGz ¶
ExtractTarGz will do the equivalent of a tar -xzvf -C and untar the tarball to whichever destination path we need to go to.
func ListAvailableVersions ¶ added in v0.1.0
ListAvailableVersions reads all available versions of Go that can be installed. It queries go.dev for what's available. By default, it'll return only the latest patches of the two most recent minor versions. For example: 1.18: 1.18.7 1.19: 1.19.2
Types ¶
type ChecksumSHA256 ¶ added in v0.1.0
type ChecksumSHA256 string
type File ¶ added in v0.1.0
type File struct { Filename string `json:"filename"` OS string `json:"os"` Arch string `json:"arch"` Version string `json:"version"` Checksum string `json:"-" datastore:",noindex"` // SHA1; deprecated ChecksumSHA256 string `json:"sha256" datastore:",noindex"` Size int64 `json:"size" datastore:",noindex"` Kind string `json:"kind"` // "archive", "installer", "source" Uploaded time.Time `json:"-"` }
This comes from https://github.com/golang/website/blob/master/internal/dl/dl.go
type Release ¶ added in v0.1.0
type Release struct { Version string `json:"version"` Stable bool `json:"stable"` Files []File `json:"files"` Visible bool `json:"-"` // show files on page load SplitPortTable bool `json:"-"` // whether files should be split by primary/other ports. }
This comes from https://github.com/golang/website/blob/master/internal/dl/dl.go