February 2018
Intermediate to advanced
340 pages
9h 43m
English
<html> <body> Hi, I'm HTML body for index.html! </body> </html>
package main import "net/http" import "html/template" func main() { tpl, err := template.ParseFiles("template.tpl") if err != nil { panic(err) } http.HandleFunc("/",func(w http.ResponseWriter, r *http.Request){ err := tpl.Execute(w, "John Doe") if err != nil { panic(err) } }) http.ListenAndServe(":8080", nil) }
Read now
Unlock full access