diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-04 19:30:25 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-04 19:30:25 -0400 |
| commit | 81522cbae16c6aadb1b789f3f875dc50f10cc005 (patch) | |
| tree | ab95db0a843783d4cfcd328e091a01597e241ee1 /main.go | |
| parent | f154ae1ec88146017abf3de9d14d119facb5fc4c (diff) | |
| download | lastfm-api-81522cbae16c6aadb1b789f3f875dc50f10cc005.tar.gz | |
Clean up
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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() { |
