envctx

package
v0.7.175 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package envctx carries an environment variable slice in a context so in-process callers (like the watch daemon) can override the process env without calling os.Setenv.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environ

func Environ(ctx context.Context) []string

Environ returns the env slice stored in ctx, or os.Environ() if none.

func Getenv

func Getenv(ctx context.Context, key string) string

Getenv returns the value of key from the env slice stored in ctx. Falls back to os.Getenv only when ctx carries no slice; an absent key returns "" without consulting os.Getenv.

func WithEnv

func WithEnv(ctx context.Context, env []string) context.Context

WithEnv returns a ctx that carries env (a slice of KEY=VALUE strings). Subsequent Getenv and Environ calls on that ctx consult env first.

Types

This section is empty.

Jump to

Keyboard shortcuts

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