Skip to content

Commit

Permalink
tcp: remove host constraint when listening
Browse files Browse the repository at this point in the history
  • Loading branch information
iwasaki-kenta committed Feb 19, 2019
1 parent fe653d5 commit 7c4b1b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions transport/tcp.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package transport

import (
"fmt"
"github.com/pkg/errors"
"net"
"strconv"
"time"
)

Expand All @@ -20,7 +20,7 @@ func (t tcp) Listen(host string, port uint16) (net.Listener, error) {
return nil, errors.Errorf("unable to parse host as IP: %s", host)
}

listener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", host, port))
listener, err := net.Listen("tcp", ":"+strconv.Itoa(int(port)))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7c4b1b7

Please sign in to comment.