From 3a5098fcc1956e8f73752990f8ed5f25e0ef7c8c Mon Sep 17 00:00:00 2001 From: thewhitetulip Date: Sat, 21 Nov 2015 10:05:57 +0530 Subject: [PATCH] handled change in template extension --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index e442938..a22985d 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ func main() { files, err := ioutil.ReadDir("./templates") for _, file := range files { filename := file.Name() - if strings.HasSuffix(filename, ".gtpl") { + if strings.HasSuffix(filename, ".html") { allFiles = append(allFiles, "./templates/"+filename) } } @@ -39,12 +39,12 @@ func main() { fmt.Println(err) } templates, err = template.ParseFiles(allFiles...) - homeTemplate = templates.Lookup("home.gtpl") - deletedTemplate = templates.Lookup("deleted.gtpl") + homeTemplate = templates.Lookup("home.html") + deletedTemplate = templates.Lookup("deleted.html") - editTemplate = templates.Lookup("edit.gtpl") - searchTemplate = templates.Lookup("search.gtpl") - completedTemplate = templates.Lookup("completed.gtpl") + editTemplate = templates.Lookup("edit.html") + searchTemplate = templates.Lookup("search.html") + completedTemplate = templates.Lookup("completed.html") router := httprouter.New() router.GET("/", ShowAllTasks)