From 3d8ce8b4317f1d0f73fb9b4d3992f1f8a2a4c124 Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Tue, 23 Jul 2024 13:26:51 -0400 Subject: [PATCH] fix linter --- components/mocks/mockNetwork.go | 2 +- network/hybridNetwork.go | 2 +- network/p2p/http.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/mocks/mockNetwork.go b/components/mocks/mockNetwork.go index 902eabb82e..4f145b1841 100644 --- a/components/mocks/mockNetwork.go +++ b/components/mocks/mockNetwork.go @@ -103,7 +103,7 @@ func (network *MockNetwork) ClearProcessors() { func (network *MockNetwork) RegisterHTTPHandler(path string, handler http.Handler) { } -// RegisterHTTPHandler - empty implementation +// RegisterHTTPHandlerFunc - empty implementation func (network *MockNetwork) RegisterHTTPHandlerFunc(path string, handler func(http.ResponseWriter, *http.Request)) { } diff --git a/network/hybridNetwork.go b/network/hybridNetwork.go index 2c27fc071a..c955dfff1a 100644 --- a/network/hybridNetwork.go +++ b/network/hybridNetwork.go @@ -146,7 +146,7 @@ func (n *HybridP2PNetwork) RegisterHTTPHandler(path string, handler http.Handler n.wsNetwork.RegisterHTTPHandler(path, handler) } -// RegisterHTTPHandler implements GossipNode +// RegisterHTTPHandlerFunc implements GossipNode func (n *HybridP2PNetwork) RegisterHTTPHandlerFunc(path string, handlerFunc func(http.ResponseWriter, *http.Request)) { n.p2pNetwork.RegisterHTTPHandlerFunc(path, handlerFunc) n.wsNetwork.RegisterHTTPHandlerFunc(path, handlerFunc) diff --git a/network/p2p/http.go b/network/p2p/http.go index 31f8f197a4..07f27afff1 100644 --- a/network/p2p/http.go +++ b/network/p2p/http.go @@ -57,6 +57,7 @@ func (s *HTTPServer) RegisterHTTPHandler(path string, handler http.Handler) { }) } +// RegisterHTTPHandlerFunc registers a http handler with a given path. func (s *HTTPServer) RegisterHTTPHandlerFunc(path string, handler func(http.ResponseWriter, *http.Request)) { s.p2phttpMux.HandleFunc(path, handler) s.p2phttpMuxRegistrarOnce.Do(func() {