envsubst
is a Go package for expanding variables in a string using ${var}
syntax.
Includes support for bash string replacement functions.
Documentation can be found on GoDoc.
${var^}
${var^^}
${var,}
${var,,}
${var:position}
${var:position:length}
${var#substring}
${var##substring}
${var%substring}
${var%%substring}
${var/substring/replacement}
${var//substring/replacement}
${var/#substring/replacement}
${var/%substring/replacement}
${#var}
${var=default}
${var:=default}
${var:-default}
${var-default}
${var+default}
${var:?default}
${var:+default}