summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo.go
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-01-19 03:06:07 +0100
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-19 03:06:07 +0100
commitc23dfd99dd3a719b03d735161082022abaafa208 (patch)
tree30a0ca80459a1b3978bf11a2f132e7c547d7a774 /hugolib/hugo.go
parent7257ab6855df7c5c0a1614daee39bdc684ae8056 (diff)
Use an init() method to create the HugoInfo instance
See #570
Diffstat (limited to 'hugolib/hugo.go')
-rw-r--r--hugolib/hugo.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/hugolib/hugo.go b/hugolib/hugo.go
index 3e4d02039..b90373b3c 100644
--- a/hugolib/hugo.go
+++ b/hugolib/hugo.go
@@ -17,14 +17,11 @@ type HugoInfo struct {
BuildDate string
}
-func getHugoInfo() *HugoInfo {
- if hugoInfo == nil {
- hugoInfo = &HugoInfo{
- Version: Version,
- CommitHash: CommitHash,
- BuildDate: BuildDate,
- Generator: `<meta name="generator" content="Hugo ` + Version + `" />`,
- }
+func init() {
+ hugoInfo = &HugoInfo{
+ Version: Version,
+ CommitHash: CommitHash,
+ BuildDate: BuildDate,
+ Generator: `<meta name="generator" content="Hugo ` + Version + `" />`,
}
- return hugoInfo
}