envsubst

package
v1.28.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package envsubst manage the replacemes of env variables in a file

Index

Constants

This section is empty.

Variables

View Source
var ErrEnvVarNotFound = errors.New("could not find environment variable")

ErrEnvVarNotFound is thrown when a SHELL-FORMAT var in a file does not have a matching env variable

Functions

func Envsubst

func Envsubst(vars map[string]string, data []byte) ([]byte, error)

Envsubst substitutes any SHELL-FORMAT variables embedded in a file by the value of the corresponding environment variable, provided in `vars`

SHELL-FORMAT is, `${foo}` BUT NOT `$foo`, for simplicity of implementation

NOTE: If a variable embedded in the file is not provided in the `vars` argument, this function will error out. This is different from the behavior of the `envsubst` shell command: in testing we should avoid silent failures

Types

This section is empty.

Jump to

Keyboard shortcuts

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