diff --git a/template/template.go b/template/template.go index cb54b8cb63..d1eb5fec43 100644 --- a/template/template.go +++ b/template/template.go @@ -16,6 +16,7 @@ package template import ( "bytes" "net/url" + "os" "path/filepath" "regexp" "sort" @@ -135,6 +136,8 @@ var DefaultFuncs = FuncMap{ re := regexp.MustCompile(pattern) return re.ReplaceAllString(text, repl) }, + "env": func(s string) string { return os.Getenv(s) }, + "expandenv": func(s string) string { return os.ExpandEnv(s) }, } // Pair is a key/value string pair.