First of all, I am still not clear how to frame this question, but I am not able to understand, can someone help me in understanding this. Why does the below code errors out if I rename "serveHTTP" or not have that method.
prog.go:17: cannot use &status (type *statusHandler) as type http.Handler in argument to httptest.NewServer:
*statusHandler does not implement http.Handler (missing ServeHTTP method)
[process exited with non-zero status]
for the below code
type statusHandler int
func (s *statusHandler) aServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Println(" inside status handler serve http")
}
func main() {
status := statusHandler(400)
s := httptest.NewServer(&status)
log.Println("value of s is %d", s)
defer s.Close()
}