summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.go b/main.go
index bb8b272..de62f7a 100644
--- a/main.go
+++ b/main.go
@@ -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)