aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-04 19:30:25 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-04 19:30:25 -0400
commit81522cbae16c6aadb1b789f3f875dc50f10cc005 (patch)
treeab95db0a843783d4cfcd328e091a01597e241ee1 /main.go
parentf154ae1ec88146017abf3de9d14d119facb5fc4c (diff)
downloadlastfm-api-81522cbae16c6aadb1b789f3f875dc50f10cc005.tar.gz
Clean up
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
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() {