From d0c9de5a6510c7ce14f0456e84be65eb35a0f32b Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Mon, 4 Apr 2022 13:04:45 +0200 Subject: rename "a Handler" -> "h Handler" --- pkg/instance/handler.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/instance/handler.go b/pkg/instance/handler.go index de1cc86..ca3395e 100644 --- a/pkg/instance/handler.go +++ b/pkg/instance/handler.go @@ -28,23 +28,23 @@ func (h Handler) Path() string { } // ServeHTTP is part of the http.Handler interface -func (a Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { +func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { start := time.Now() code := 0 defer func() { end := time.Now().Sub(start).Seconds() sc := fmt.Sprintf("%d", code) - rspcnt.Inc(a.Instance.LogID, string(a.Endpoint), sc) - latency.Observe(end, a.Instance.LogID, string(a.Endpoint), sc) + rspcnt.Inc(h.Instance.LogID, string(h.Endpoint), sc) + latency.Observe(end, h.Instance.LogID, string(h.Endpoint), sc) }() - reqcnt.Inc(a.Instance.LogID, string(a.Endpoint)) + reqcnt.Inc(h.Instance.LogID, string(h.Endpoint)) - code = a.verifyMethod(w, r) + code = h.verifyMethod(w, r) if code != 0 { return } - code = a.handle(w, r) + code = h.handle(w, r) } // verifyMethod checks that an appropriate HTTP method is used. Error handling -- cgit v1.2.3