diff --git a/core/connmgr/null.go b/core/connmgr/null.go index 61c92c4c5..3c7e6aef0 100644 --- a/core/connmgr/null.go +++ b/core/connmgr/null.go @@ -16,7 +16,7 @@ func (NullConnMgr) TagPeer(peer.ID, string, int) {} func (NullConnMgr) UntagPeer(peer.ID, string) {} func (NullConnMgr) UpsertTag(peer.ID, string, func(int) int) {} func (NullConnMgr) GetTagInfo(peer.ID) *TagInfo { return &TagInfo{} } -func (NullConnMgr) TrimOpenConns(_ context.Context) {} +func (NullConnMgr) TrimOpenConns(_ context.Context) {} func (NullConnMgr) Notifee() network.Notifiee { return network.GlobalNoopNotifiee } func (NullConnMgr) Protect(peer.ID, string) {} func (NullConnMgr) Unprotect(peer.ID, string) bool { return false } diff --git a/core/network/notifee.go b/core/network/notifee.go index d320b57ab..525190e59 100644 --- a/core/network/notifee.go +++ b/core/network/notifee.go @@ -61,7 +61,7 @@ type NoopNotifiee struct{} var _ Notifiee = (*NoopNotifiee)(nil) -func (nn *NoopNotifiee) Connected(_ Network, _ Conn) {} -func (nn *NoopNotifiee) Disconnected(_ Network, _ Conn) {} +func (nn *NoopNotifiee) Connected(_ Network, _ Conn) {} +func (nn *NoopNotifiee) Disconnected(_ Network, _ Conn) {} func (nn *NoopNotifiee) Listen(_ Network, _ ma.Multiaddr) {} func (nn *NoopNotifiee) ListenClose(_ Network, _ ma.Multiaddr) {} diff --git a/core/network/rcmgr.go b/core/network/rcmgr.go index 11b2ade47..83bbf4f1f 100644 --- a/core/network/rcmgr.go +++ b/core/network/rcmgr.go @@ -343,18 +343,18 @@ func (n *NullResourceManager) Close() error { return nil } -func (n *NullScope) ReserveMemory(_ int, _ uint8) error { return nil } +func (n *NullScope) ReserveMemory(_ int, _ uint8) error { return nil } func (n *NullScope) ReleaseMemory(_ int) {} -func (n *NullScope) Stat() ScopeStat { return ScopeStat{} } -func (n *NullScope) BeginSpan() (ResourceScopeSpan, error) { return &NullScope{}, nil } -func (n *NullScope) Done() {} -func (n *NullScope) Name() string { return "" } -func (n *NullScope) Protocol() protocol.ID { return "" } -func (n *NullScope) Peer() peer.ID { return "" } -func (n *NullScope) PeerScope() PeerScope { return &NullScope{} } -func (n *NullScope) SetPeer(peer.ID) error { return nil } -func (n *NullScope) ProtocolScope() ProtocolScope { return &NullScope{} } -func (n *NullScope) SetProtocol(_ protocol.ID) error { return nil } -func (n *NullScope) ServiceScope() ServiceScope { return &NullScope{} } -func (n *NullScope) SetService(_ string) error { return nil } -func (n *NullScope) VerifySourceAddress(_ net.Addr) bool { return false } +func (n *NullScope) Stat() ScopeStat { return ScopeStat{} } +func (n *NullScope) BeginSpan() (ResourceScopeSpan, error) { return &NullScope{}, nil } +func (n *NullScope) Done() {} +func (n *NullScope) Name() string { return "" } +func (n *NullScope) Protocol() protocol.ID { return "" } +func (n *NullScope) Peer() peer.ID { return "" } +func (n *NullScope) PeerScope() PeerScope { return &NullScope{} } +func (n *NullScope) SetPeer(peer.ID) error { return nil } +func (n *NullScope) ProtocolScope() ProtocolScope { return &NullScope{} } +func (n *NullScope) SetProtocol(_ protocol.ID) error { return nil } +func (n *NullScope) ServiceScope() ServiceScope { return &NullScope{} } +func (n *NullScope) SetService(_ string) error { return nil } +func (n *NullScope) VerifySourceAddress(_ net.Addr) bool { return false } diff --git a/p2p/host/basic/natmgr.go b/p2p/host/basic/natmgr.go index 2a5219418..bbd6ceb33 100644 --- a/p2p/host/basic/natmgr.go +++ b/p2p/host/basic/natmgr.go @@ -292,8 +292,8 @@ func (nmgr *natManager) GetMapping(addr ma.Multiaddr) ma.Multiaddr { type nmgrNetNotifiee natManager -func (nn *nmgrNetNotifiee) natManager() *natManager { return (*natManager)(nn) } -func (nn *nmgrNetNotifiee) Listen(network.Network, ma.Multiaddr) { nn.natManager().sync() } +func (nn *nmgrNetNotifiee) natManager() *natManager { return (*natManager)(nn) } +func (nn *nmgrNetNotifiee) Listen(network.Network, ma.Multiaddr) { nn.natManager().sync() } func (nn *nmgrNetNotifiee) ListenClose(_ network.Network, _ ma.Multiaddr) { nn.natManager().sync() } -func (nn *nmgrNetNotifiee) Connected(network.Network, network.Conn) {} -func (nn *nmgrNetNotifiee) Disconnected(network.Network, network.Conn) {} +func (nn *nmgrNetNotifiee) Connected(network.Network, network.Conn) {} +func (nn *nmgrNetNotifiee) Disconnected(network.Network, network.Conn) {} diff --git a/p2p/net/connmgr/connmgr_test.go b/p2p/net/connmgr/connmgr_test.go index 9e58c8acb..e8e61914d 100644 --- a/p2p/net/connmgr/connmgr_test.go +++ b/p2p/net/connmgr/connmgr_test.go @@ -804,20 +804,20 @@ type mockConn struct { stats network.ConnStats } -func (m mockConn) Close() error { panic("implement me") } -func (m mockConn) CloseWithError(_ network.ConnErrorCode) error { panic("implement me") } -func (m mockConn) LocalPeer() peer.ID { panic("implement me") } -func (m mockConn) RemotePeer() peer.ID { panic("implement me") } -func (m mockConn) RemotePublicKey() crypto.PubKey { panic("implement me") } -func (m mockConn) LocalMultiaddr() ma.Multiaddr { panic("implement me") } -func (m mockConn) RemoteMultiaddr() ma.Multiaddr { panic("implement me") } -func (m mockConn) Stat() network.ConnStats { return m.stats } -func (m mockConn) ID() string { panic("implement me") } -func (m mockConn) IsClosed() bool { panic("implement me") } +func (m mockConn) Close() error { panic("implement me") } +func (m mockConn) CloseWithError(_ network.ConnErrorCode) error { panic("implement me") } +func (m mockConn) LocalPeer() peer.ID { panic("implement me") } +func (m mockConn) RemotePeer() peer.ID { panic("implement me") } +func (m mockConn) RemotePublicKey() crypto.PubKey { panic("implement me") } +func (m mockConn) LocalMultiaddr() ma.Multiaddr { panic("implement me") } +func (m mockConn) RemoteMultiaddr() ma.Multiaddr { panic("implement me") } +func (m mockConn) Stat() network.ConnStats { return m.stats } +func (m mockConn) ID() string { panic("implement me") } +func (m mockConn) IsClosed() bool { panic("implement me") } func (m mockConn) NewStream(_ context.Context) (network.Stream, error) { panic("implement me") } -func (m mockConn) GetStreams() []network.Stream { panic("implement me") } -func (m mockConn) Scope() network.ConnScope { panic("implement me") } -func (m mockConn) ConnState() network.ConnectionState { return network.ConnectionState{} } +func (m mockConn) GetStreams() []network.Stream { panic("implement me") } +func (m mockConn) Scope() network.ConnScope { panic("implement me") } +func (m mockConn) ConnState() network.ConnectionState { return network.ConnectionState{} } func makeSegmentsWithPeerInfos(peerInfos peerInfos) *segments { var s = func() *segments {