Help us shape the future of Go! Take the 2026 Go Developer Survey

install

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package install provides installation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsPath

func ContainsPath(pathEnv, dir string) bool

ContainsPath checks if the given directory is in the PATH environment variable.

func DefaultUserBin

func DefaultUserBin() string

DefaultUserBin returns a sensible per-user bin directory per OS.

func ExecuteInstall

func ExecuteInstall(opts Options) ([]string, error)

ExecuteInstall performs the install actions (will create dirs, copy file, set modes). It returns human-friendly messages describing what was actually done (created directories, copied the binary, added to PATH, etc.).

func PlanInstall

func PlanInstall(opts Options) ([]string, string, error)

PlanInstall returns a list of human-readable actions that would be performed.

func PlanUninstall

func PlanUninstall() ([]string, error)

PlanUninstall returns a list of actions that would be performed by Uninstall.

func Uninstall

func Uninstall(verbose bool) ([]string, error)

Uninstall removes previously installed binary and reverses PATH modifications.

Types

type Options

type Options struct {
	User      bool
	System    bool
	Path      string
	From      string
	DryRun    bool
	Check     bool
	Yes       bool
	AddToPath bool // if true, installer will add target dir to PATH (with confirmation)
}

Options controls install behavior.

type Status

type Status struct {
	UserPath        string
	SystemPath      string
	UserInstalled   bool
	SystemInstalled bool
	UserOnPath      bool
	SystemOnPath    bool
	MetadataFound   bool
}

Status represents the presence of krnr in user and system locations and PATH.

func GetStatus

func GetStatus() (*Status, error)

GetStatus inspects the system and returns installation status for user and system locations.

Jump to

Keyboard shortcuts

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