diff options
author | raylu <raylu@mixpanel.com> | 2011-08-01 02:34:41 -0700 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-08-01 02:34:41 -0700 |
commit | f9803a3bbfb3e730213825d6dc332b7c31321330 (patch) | |
tree | 486553d015e100e87dd7f37daeaf65fea38a86fd /main.go | |
parent | 5395b5ada15dfc417cbe789ea3297274f050892d (diff) | |
download | audioaxis-f9803a3bbfb3e730213825d6dc332b7c31321330.tar.xz |
use new exp/template, make stuff work
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -3,7 +3,7 @@ package main import ( "fmt" "http" - "template" + "exp/template" mysql "github.com/Philio/GoMySQL" "os" ) @@ -67,7 +67,7 @@ func playlist(w http.ResponseWriter, r *http.Request) { } if debug { - t, err := template.ParseFile("templates/p.html", nil) + t, err := template.ParseFile("templates/p.html") if err != nil { http.Error(w, err.String(), http.StatusInternalServerError) return @@ -88,8 +88,13 @@ func playlist(w http.ResponseWriter, r *http.Request) { func main() { templates = make(map[string]*template.Template) - for _, t:= range []string{"p"} { - templates[t] = template.MustParseFile("templates/" + t + ".html", nil) + for _, path := range []string{"p"} { + t, err := template.ParseFile("templates/" + path + ".html") + if err != nil { + fmt.Println(err) + return + } + templates[path] = t } http.HandleFunc("/", home) |