Documentation
¶
Overview ¶
Package envutil provides helpers for threaded environment variable management. Instead of mutating the global process environment with os.Setenv (which causes race conditions between concurrent runs), callers pass explicit env var maps through the execution chain. Each helper falls back to the process environment when the explicit map is nil (CLI path).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
Lookup returns the value for key from envVars. When envVars is nil, falls back to os.Getenv(key) — preserves the legacy "no map = inherit process env" behavior. When envVars is non-nil, returns "" for absent keys (no fallback) so dev-shell process env can't leak into callers that pass an explicit map.
func MergeWithProcessEnv ¶
MergeWithProcessEnv returns a copy of os.Environ() with the provided env vars merged on top. If envVars is nil, returns os.Environ() as-is.
Types ¶
This section is empty.