Commit 5a21aa94 authored by Marten Seemann's avatar Marten Seemann

be explicit about the interfaces implemented

parent 9e9c6d16
...@@ -25,6 +25,8 @@ type TcpTransport struct { ...@@ -25,6 +25,8 @@ type TcpTransport struct {
listeners map[string]tpt.Listener listeners map[string]tpt.Listener
} }
var _ tpt.Transport = &TcpTransport{}
// NewTCPTransport creates a tcp transport object that tracks dialers and listeners // NewTCPTransport creates a tcp transport object that tracks dialers and listeners
// created. It represents an entire tcp stack (though it might not necessarily be) // created. It represents an entire tcp stack (though it might not necessarily be)
func NewTCPTransport() *TcpTransport { func NewTCPTransport() *TcpTransport {
...@@ -135,6 +137,8 @@ type tcpDialer struct { ...@@ -135,6 +137,8 @@ type tcpDialer struct {
transport tpt.Transport transport tpt.Transport
} }
var _ tpt.Dialer = &tcpDialer{}
func (t *TcpTransport) newTcpDialer(base manet.Dialer, laddr ma.Multiaddr, doReuse bool) (*tcpDialer, error) { func (t *TcpTransport) newTcpDialer(base manet.Dialer, laddr ma.Multiaddr, doReuse bool) (*tcpDialer, error) {
// get the local net.Addr manually // get the local net.Addr manually
la, err := manet.ToNetAddr(laddr) la, err := manet.ToNetAddr(laddr)
...@@ -238,6 +242,8 @@ type tcpListener struct { ...@@ -238,6 +242,8 @@ type tcpListener struct {
transport tpt.Transport transport tpt.Transport
} }
var _ tpt.Listener = &tcpListener{}
func (d *tcpListener) Accept() (tpt.Conn, error) { func (d *tcpListener) Accept() (tpt.Conn, error) {
c, err := d.list.Accept() c, err := d.list.Accept()
if err != nil { if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment