usrlocal

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExecutableViaArgs0 = sync.OnceValues(func() (string, error) {
	if os.Args[0] == "" {
		return "", errors.New("os.Args[0] has not been set")
	}
	executable, err := exec.LookPath(os.Args[0])
	if err == nil {
		executable, err = filepath.Abs(executable)
	}
	if err != nil {
		return "", fmt.Errorf("os.Args[0] is invalid: %w", err)
	}

	return executable, nil
})

ExecutableViaArgs0 returns the absolute path to the executable used to start this process. It will also append the file extension on Windows, if necessary. This function is different from os.Executable(), which will use /proc/self/exe on Linux and therefore will resolve any symlink used to locate the executable. This function will return the symlink instead because we want to be able to locate ../share/lima relative to the location of the symlink, and not the actual executable. This is important when using Homebrew.

Functions

func GuestAgentBinary

func GuestAgentBinary(ostype limatype.OS, arch limatype.Arch) (string, error)

GuestAgentBinary returns the absolute path of the guest agent binary, possibly with ".gz" suffix.

func LibexecLima

func LibexecLima() ([]string, error)

LibexecLima returns the <PREFIX>/libexec/lima directories. For Homebrew compatibility, it also checks <PREFIX>/lib/lima.

func SelfDirs

func SelfDirs() []string

SelfDirs returns a list of directory paths where the current executable might be located. It checks both os.Args[0] and os.Executable() methods and returns directories containing the executable, resolving symlinks as needed.

func ShareLima

func ShareLima() ([]string, error)

ShareLima returns the <PREFIX>/share/lima directories.

Types

This section is empty.

Jump to

Keyboard shortcuts

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