package main import "net/http" type v1Handler struct { healthCheck *healthCheckHandler } func (h *v1Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { var head string head, r.URL.Path = shiftPath(r.URL.Path) switch head { case "health": h.healthCheck.ServeHTTP(w, r) default: http.Error(w, "Not Found", http.StatusNotFound) } }