From a0447345418e735a4b0fd401c1610950f66ed778 Mon Sep 17 00:00:00 2001 From: quoha Date: Sun, 15 Mar 2015 20:56:20 -0500 Subject: [PATCH] Add "getenv" as an wrapper for os.Getenv Add a wrapper for the os.Getenv function. The wrapper takes as input a string that is assumed to be an exported variable name. Fixes #977 --- tpl/template.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tpl/template.go b/tpl/template.go index 9322dc009..499e83186 100644 --- a/tpl/template.go +++ b/tpl/template.go @@ -1341,6 +1341,7 @@ func init() { "getCSV": GetCSV, "getCsv": GetCSV, "seq": helpers.Seq, + "getenv": func(varName string) string { return os.Getenv(varName) }, } }