When I first saw code like this, it felt as if too many things were happening in one line:

mux.Handle("GET /health", health.NewHandler(healthService))

Enter fullscreen mode

Exit fullscreen mode

What is a mux? Why are we giving it a handler? How does the handler get the service? Who calls ServeHTTP?