(w http.ResponseWriter, statusCode int, d interface{})
| 40 | } |
| 41 | |
| 42 | func respond(w http.ResponseWriter, statusCode int, d interface{}) error { |
| 43 | w.Header().Set("Content-Type", "application/json") |
| 44 | w.WriteHeader(statusCode) |
| 45 | err := json.NewEncoder(w).Encode(d) |
| 46 | return err |
| 47 | } |
| 48 | |
| 49 | func serveFileHandler(box *packr.Box, filename string) http.Handler { |
| 50 | return HandlerFunc(serveFile(box, filename)) |
no outgoing calls