projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32bf8b7
)
Add "getenv" as an wrapper for os.Getenv
author
quoha
<quoha@quoha.org>
Mon, 16 Mar 2015 01:56:20 +0000
(20:56 -0500)
committer
bep
<bjorn.erik.pedersen@gmail.com>
Mon, 16 Mar 2015 17:38:43 +0000
(18:38 +0100)
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
patch
|
blob
|
history
diff --git
a/tpl/template.go
b/tpl/template.go
index 9322dc0092203d7708467bce14fbd7dcf9e3e045..499e831862cf89da617c24153e7b2b097e03e3c6 100644
(file)
--- 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) },
}
}