Function
handler
(w http.ResponseWriter, r *http.Request)
Source from the content-addressed store, hash-verified
| 22 | } |
| 23 | |
| 24 | func handler(w http.ResponseWriter, r *http.Request) { |
| 25 | var data struct { |
| 26 | Name string |
| 27 | } |
| 28 | if strings.HasPrefix(r.URL.Path, "/hello") { |
| 29 | data.Name = r.FormValue("name") |
| 30 | if data.Name == "" { |
| 31 | data.Name = "friend" |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | if err := engine.Render(w, "index.html", data); err != nil { |
| 36 | log.Println("error during render:", err) |
| 37 | } |
| 38 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected