Skip to content

Commit

Permalink
Add "getenv" as an wrapper for os.Getenv
Browse files Browse the repository at this point in the history
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 gohugoio#977
  • Loading branch information
quoha authored and tychoish committed Aug 13, 2017
1 parent 33dc342 commit 67068d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tpl/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ func init() {
"getCSV": GetCSV,
"getCsv": GetCSV,
"seq": helpers.Seq,
"getenv": func(varName string) string { return os.Getenv(varName) },
}

}

0 comments on commit 67068d0

Please sign in to comment.