From: quoha Date: Mon, 16 Mar 2015 01:56:20 +0000 (-0500) Subject: Add "getenv" as an wrapper for os.Getenv X-Git-Tag: v0.14~192 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a0447345418e735a4b0fd401c1610950f66ed778;p=brevno-suite%2Fhugo 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 --- diff --git a/tpl/template.go b/tpl/template.go index 9322dc00..499e8318 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) }, } }