stringHandler returns a handler func that writes a message 's' to the http.ResponseWriter.
(s string)
| 2943 | // stringHandler returns a handler func that writes a message 's' to the |
| 2944 | // http.ResponseWriter. |
| 2945 | func stringHandler(s string) http.HandlerFunc { |
| 2946 | return func(w http.ResponseWriter, r *http.Request) { |
| 2947 | _, err := w.Write([]byte(s)) |
| 2948 | if err != nil { |
| 2949 | log.Printf("Failed writing HTTP response: %v", err) |
| 2950 | } |
| 2951 | } |
| 2952 | } |
| 2953 | |
| 2954 | // newRequest is a helper function to create a new request with a method and url. |
| 2955 | // The request returned is a 'server' request as opposed to a 'client' one through |
no test coverage detected