gotoolchain

package module
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 8 Imported by: 0

README

gotoolchain

This modules is used to manage Go toolchain versions.

This is copyrighted and made freely available under the terms of the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RootDir      string
	ToolchainDir string
	DownloadDir  string
	VersionFile  string

} //func

Config contains configuration values.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with the default location provided. It assumes the user as a home directory. If none is available this function will panic.

func NewConfig

func NewConfig(root string) *Config

NewConfig creates a new Config. It accepts a root and derives the toolchains and downloads at root/toolchains and root/downloads respectively.

type Manager

type Manager struct {
	// contains filtered or unexported fields

} //struct

Manager queries and modifies a Go toolchains directory.

func NewManager

func NewManager(cfg *Config) *Manager

NewManager creates a new Manager. If the provided Config is nil then DefaultConfig() is called and used.nil

func (*Manager) Contains

func (m *Manager) Contains(v *Version) (found bool, err error)

Contains will check if a Go toolchain for the provided Version exists.

func (*Manager) GetCurrentVersion

func (m *Manager) GetCurrentVersion() (*Version, error)

GetCurrentVersion reads the current Version from the current version file.

func (*Manager) InstallToolchainFS

func (m *Manager) InstallToolchainFS(toolchain fs.FS, v *Version) (err error)

InstallToolchainFS will install a Go toolchain from the provided toolchain. It will install it useing the provided Version so that multiple toolchain verions may be installed simultaneously.

func (*Manager) ListVersions

func (m *Manager) ListVersions() ([]*Version, error)

ListVersions will list all the Versions.

func (*Manager) Remove

func (m *Manager) Remove(v *Version)

Remove a Version from the toolchains directory.

func (*Manager) SetCurrentVersion

func (m *Manager) SetCurrentVersion(v *Version) error

SetCurrentVerion will set the current version to the provided Version.

type Version deprecated

type Version = gosem.Version

Version type alias to gosem.Version.

Deprecated: This will be removed in the future. Use codeberg.org/GoSelect/gosem.Version instead.

Jump to

Keyboard shortcuts

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