From 81522cbae16c6aadb1b789f3f875dc50f10cc005 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Sun, 4 Jun 2017 19:30:25 -0400 Subject: Clean up --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 4065dad..4f34f66 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,10 @@ func New() *App { blockKey, err := hex.DecodeString(config.HashKey) s := securecookie.New(hashKey, blockKey) app.CookieHandler = s - templates := template.Must(template.ParseGlob("templates/*.tmpl")) + fmap := template.FuncMap{ + "ago": ago, + } + templates := template.Must(template.New("").Funcs(fmap).ParseGlob("templates/*.tmpl")) app.Template = templates return app } @@ -51,6 +54,7 @@ func logg(fn http.HandlerFunc) http.HandlerFunc { } func main() { + log.SetFlags(log.LstdFlags | log.Lshortfile) app := New() go func() { -- cgit v1.2.3-70-g09d2