diff options
Diffstat (limited to 'gopher/serve.go')
-rw-r--r-- | gopher/serve.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gopher/serve.go b/gopher/serve.go index bad7935..7b32f2f 100644 --- a/gopher/serve.go +++ b/gopher/serve.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "net" - "strings" sr "tildegit.org/tjp/sliderule" "tildegit.org/tjp/sliderule/internal" @@ -31,9 +30,8 @@ func NewServer( ) (sr.Server, error) { gs := &gopherServer{handler: handler} - if strings.IndexByte(hostname, ':') < 0 { - hostname = net.JoinHostPort(hostname, "70") - } + hostname = internal.JoinDefaultPort(hostname, "70") + address = internal.JoinDefaultPort(address, "70") var err error gs.Server, err = internal.NewServer(ctx, hostname, network, address, errLog, gs.handleConn) |