Skip to content

Commit

Permalink
Fix typo in comments about Port=0
Browse files Browse the repository at this point in the history
  • Loading branch information
film42 committed Jul 22, 2017
1 parent f4f60ea commit 4050af0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ func (c *connection) Dial(network, address string) (net.Conn, error) {
goto fallback
}

// Ensure the TCPAddr has its Port set to 0, which is way of telling the dialer to use
// and random port.
switch tcpAddr := c.localAddr.(type) {
case *net.TCPAddr:
// Ensure the TCPAddr has its Port set to 0, which is way of telling the dialer to
// use any random port. If you don't change this, you'll get a bind error.
tcpAddr.Port = 0
default:
logger.Warn.Println(c.id, "Ignoring local net.Addr", c.localAddr, "because net.TCPAddr was expected")
Expand Down

0 comments on commit 4050af0

Please sign in to comment.