expand

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package expand implements ${VAR} substitution for commands and env files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OSLookup

func OSLookup(extra map[string]string) func(key string) (string, bool)

OSLookup returns a lookup func backed by the process environment. Keys in extra take precedence over environment variables.

func Vars

func Vars(s string, lookup func(key string) (string, bool)) string

Vars replaces every ${VAR} reference in s using lookup. References that lookup cannot resolve are left untouched, so downstream shells can still expand them. Only the braced form is recognized; a bare $VAR is passed through as-is.

Types

This section is empty.

Jump to

Keyboard shortcuts

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