From a088c2b56cf56dccd9e4bf3ec55cd23391ba298f Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 19 Oct 2019 17:31:28 +0200 Subject: cleaned stuff --- src/http.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/http.go b/src/http.go index 88326fc..e08ed68 100644 --- a/src/http.go +++ b/src/http.go @@ -54,8 +54,6 @@ func viewGetHandler(w http.ResponseWriter, r *http.Request) { // get all challenges from the db challs := getAllChallenges(db) - log.Println("got all challenges") - // define a challenges struct storing the challenges. // This struct can be used in a template challenges := Challenges{} @@ -64,12 +62,7 @@ func viewGetHandler(w http.ResponseWriter, r *http.Request) { challenges.Challenge = append(challenges.Challenge, chal) } - log.Println("Done inserting all the challengesi nto the challenges struct") - - fmt.Printf("challenges: %#v\n", challenges) - - log.Println("Generating a new template used to render the challenges") - + // define a new template to render the challenges in t := template.New("") t, err := t.ParseFiles("./hosted/view.html") if err != nil { @@ -77,14 +70,8 @@ func viewGetHandler(w http.ResponseWriter, r *http.Request) { return } - log.Println("Done generating and parsing the template") - + // execure the template using the challenges struct t.ExecuteTemplate(w, "view", challenges) - - log.Println("Done executing the template") - - // read the view.html file and write its content to the response writer - //readFileToResponse(w, "/view.html") } func editGetHandler(w http.ResponseWriter, r *http.Request) { -- cgit 1.4.1