(w http.ResponseWriter, r *http.Request)
| 32 | } |
| 33 | |
| 34 | func (sh stringHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 35 | w.Header().Set("content-type", sh.contentType) |
| 36 | io.WriteString(w, sh.body) |
| 37 | } |
| 38 | |
| 39 | func Serve(listener net.Listener) { |
| 40 | http.HandleFunc("/", viewHtml) |