shell

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsExpansion

func ContainsExpansion(value string) bool

ContainsExpansion reports whether a string contains a shell expression whose value depends on runtime environment.

func ContainsTemplate

func ContainsTemplate(value string) bool

ContainsTemplate reports whether a double-quoted string can produce a different runtime value after shell-style expansion.

func EvalRaw

func EvalRaw(raw string, env Env) (string, bool, error)

EvalRaw evaluates a standalone shell expansion.

func EvalString

func EvalString(raw string, env Env) (string, error)

EvalString evaluates shell substitutions inside a string.

func ReadExpansion

func ReadExpansion(raw string, start int) (string, int, bool)

ReadExpansion reads one shell expansion starting at start.

func ReadSingleQuotedEscape

func ReadSingleQuotedEscape(raw string, start int) (string, int, error)

ReadSingleQuotedEscape reads a backslash escape in a single-quoted shell fallback string.

func ReadStringEscape

func ReadStringEscape(raw string, start int) (string, int, error)

ReadStringEscape reads a backslash escape in a double-quoted shell string.

Types

type Env

type Env interface {
	LookupEnv(key string) (string, bool)
}

Env provides environment values for shell-style substitution.

Jump to

Keyboard shortcuts

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