Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseEnv ¶
ParseEnv implements a strict parser for environment files using a subset of POSIX shell syntax. The parser enforces that all variable values must be enclosed in single quotes.
Supported format:
- VAR='value' - Values must be enclosed in single quotes
- Content within single quotes is preserved literally (no escape sequences or expansions)
- Multi-line values are supported (newlines within single quotes are preserved)
- Inline comments after the closing quote are supported (e.g., VAR='value' # comment)
- Leading whitespace before the variable name is ignored
- Blank lines (including those with only whitespace) are ignored when not within quotes
- Lines starting with '#' are treated as comments and ignored
- Whitespace before '=' is invalid (e.g., VAR = 'value' is rejected)
- Whitespace after '=' but before the quote results in empty assignment (e.g., VAR= 'value' assigns empty string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.