diff --git a/cmd/kg/handlers.go b/cmd/kg/handlers.go index da001eb..3296a7a 100644 --- a/cmd/kg/handlers.go +++ b/cmd/kg/handlers.go @@ -118,9 +118,6 @@ func (h *graphHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Write(output) } -type healthHandler struct { -} - -func (h *healthHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) { +func healthHandler(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) } diff --git a/cmd/kg/main.go b/cmd/kg/main.go index 3ac6ae4..3baeec5 100644 --- a/cmd/kg/main.go +++ b/cmd/kg/main.go @@ -196,7 +196,7 @@ func Main() error { { // Run the HTTP server. mux := http.NewServeMux() - mux.Handle("/health", &healthHandler{}) + mux.HandleFunc("/health", healthHandler) mux.Handle("/graph", &graphHandler{m, gr, hostname, s}) mux.Handle("/metrics", promhttp.HandlerFor(r, promhttp.HandlerOpts{})) l, err := net.Listen("tcp", *listen)