golang

package
v0.0.0-...-40d5209 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package golang provides tools for Go version management on localhost.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotDownloaded = fmt.Errorf("not downloaded")

Functions

func BinaryPath

func BinaryPath(version string) (string, error)

BinaryPath returns path to go binary for provided version.

func Install

func Install(version string, force bool) error

Install installs requested Golang version. does: go install golang.org/dl/go1.10.7@latest go1.10.7 download

func List

func List(linkPath string, opts ListOpts) error

List shows Go versions available locally and remotely.

func UseBinary

func UseBinary(goBinPath string, newBin string) error

UseBinary sets goBinPath symlink to requested binary path.

func UseVersion

func UseVersion(goBinPath string, version string) error

UseVersion sets goBinPath symlink to requested Go version (must be installed).

Types

type ListOpts

type ListOpts struct {
	// ShowRemotes adds to list available remote versions.
	ShowRemotes bool
	// ShowRemotes adds to list all remote versions, not only latest minor version for every major version.
	ShowAllRemotes bool
	// ShowOutdated adds to list even old Go versions (older than 1.13).
	ShowOutdated bool
}

ListOpts controls List behaviour.

Jump to

Keyboard shortcuts

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