envvars

package
v0.54.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 2 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

View Source
const (
	PathEnvVarName  = "PATH"
	ShellEnvVarName = "SHELL"
)

Environment variable names

Variables

This section is empty.

Functions

func LoadConfiguredEnvironment

func LoadConfiguredEnvironment(customConfigFiles []string, workingDirectory string)

LoadConfiguredEnvironment updates the environment with user and local configuration. First Bash's env is read (as a fallback), then the user's preferred SHELL's env is read, then the configuration files. The Bash env PATH is appended to the existing PATH (as a fallback), any other new PATH read is prepended (preferential).

func UpdatePath

func UpdatePath(pathExtension string, prepend bool) string

UpdatePath prepends or appends the extension to the current path. For append, if the entry is already there, it will not be re-added / moved. For prepend, if the entry is already there, it will be correctly re-prioritized to the front. The result is set into the process environment with os.Setenv.

pathExtension string the path component to be added.
prepend bool whether to pre- or append

Types

This section is empty.

Jump to

Keyboard shortcuts

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