mirror of
https://github.com/libp2p/go-libp2p.git
synced 2026-04-23 00:27:05 +08:00
chore: fix revive issues
This commit is contained in:
@@ -541,7 +541,7 @@ func (h *BasicHost) EventBus() event.Bus {
|
||||
//
|
||||
// (Thread-safe)
|
||||
func (h *BasicHost) SetStreamHandler(pid protocol.ID, handler network.StreamHandler) {
|
||||
h.Mux().AddHandler(pid, func(p protocol.ID, rwc io.ReadWriteCloser) error {
|
||||
h.Mux().AddHandler(pid, func(_ protocol.ID, rwc io.ReadWriteCloser) error {
|
||||
is := rwc.(network.Stream)
|
||||
handler(is)
|
||||
return nil
|
||||
@@ -554,7 +554,7 @@ func (h *BasicHost) SetStreamHandler(pid protocol.ID, handler network.StreamHand
|
||||
// SetStreamHandlerMatch sets the protocol handler on the Host's Mux
|
||||
// using a matching function to do protocol comparisons
|
||||
func (h *BasicHost) SetStreamHandlerMatch(pid protocol.ID, m func(protocol.ID) bool, handler network.StreamHandler) {
|
||||
h.Mux().AddHandlerWithFunc(pid, m, func(p protocol.ID, rwc io.ReadWriteCloser) error {
|
||||
h.Mux().AddHandlerWithFunc(pid, m, func(_ protocol.ID, rwc io.ReadWriteCloser) error {
|
||||
is := rwc.(network.Stream)
|
||||
handler(is)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user