diff --git a/internal/core/metrics.go b/internal/core/metrics.go index f7d52d65..3548401b 100644 --- a/internal/core/metrics.go +++ b/internal/core/metrics.go @@ -34,8 +34,8 @@ type metricsParent interface { } type metrics struct { - listener net.Listener - server *http.Server + ln net.Listener + server *http.Server mutex sync.Mutex pathManager metricsPathManager @@ -48,13 +48,13 @@ func newMetrics( address string, parent metricsParent, ) (*metrics, error) { - listener, err := net.Listen("tcp", address) + ln, err := net.Listen("tcp", address) if err != nil { return nil, err } m := &metrics{ - listener: listener, + ln: ln, } router := gin.New() @@ -74,7 +74,7 @@ func (m *metrics) close() { } func (m *metrics) run() { - err := m.server.Serve(m.listener) + err := m.server.Serve(m.ln) if err != http.ErrServerClosed { panic(err) } diff --git a/internal/core/pprof.go b/internal/core/pprof.go index b77c80ec..9454e13a 100644 --- a/internal/core/pprof.go +++ b/internal/core/pprof.go @@ -16,21 +16,21 @@ type pprofParent interface { } type pprof struct { - listener net.Listener - server *http.Server + ln net.Listener + server *http.Server } func newPPROF( address string, parent pprofParent, ) (*pprof, error) { - listener, err := net.Listen("tcp", address) + ln, err := net.Listen("tcp", address) if err != nil { return nil, err } pp := &pprof{ - listener: listener, + ln: ln, } pp.server = &http.Server{ @@ -49,7 +49,7 @@ func (pp *pprof) close() { } func (pp *pprof) run() { - err := pp.server.Serve(pp.listener) + err := pp.server.Serve(pp.ln) if err != http.ErrServerClosed { panic(err) }