FAQ
Reviewers: rsc,

Message:
Hello rsc@golang.org (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
net: avoid passing an empty string as a parameter to Listen,
ListenPacket

Fixes issue 3847.
Update issue 3721.

Please review this at http://codereview.appspot.com/6533050/

Affected files:
M src/pkg/net/dial.go
M src/pkg/net/dial_test.go
M src/pkg/net/ipraw_test.go
M src/pkg/net/server_test.go
M src/pkg/net/unicast_posix_test.go

Search Discussions

  • Mikioh Mikioh at Oct 13, 2012 at 5:22 pm
  • Iant at Oct 13, 2012 at 5:33 pm
    It seems like this will break existing programs that want to use
    net.Listen or net.ListenPacket with a wildcard local address. Are you
    saying that those programs are already broken? We need to provide some
    mechanism for programs to listen on a wildcard address. And if we have
    that mechanism, why not use the empty string to ask for it?

    So this doesn't seem to me like a good way to go.


    https://codereview.appspot.com/6533050/diff/8001/src/pkg/net/dial.go
    File src/pkg/net/dial.go (right):

    https://codereview.appspot.com/6533050/diff/8001/src/pkg/net/dial.go#newcode66
    src/pkg/net/dial.go:66: // For TCP and UDP networks, addr has the
    colon-separeted form
    s/separeted/separated/

    But I'm not sure why adding "colon-separated" is helpful here--the
    example already shows a colon. Why not just leave it as it is?

    https://codereview.appspot.com/6533050/diff/8001/src/pkg/net/dial.go#newcode170
    src/pkg/net/dial.go:170: // For TCP networks, laddr has the
    colon-separeted form "host:port".
    s/separeted/separated/

    https://codereview.appspot.com/6533050/diff/8001/src/pkg/net/dial.go#newcode195
    src/pkg/net/dial.go:195: // For UDP networks, laddr has the
    colon-separeted form "host:port".
    s/separeted/separated/

    https://codereview.appspot.com/6533050/
  • Russ Cox at Oct 21, 2012 at 9:24 pm
    Same comments. Same program too: s/ListenTCP("tcp", nil)/Listen("tcp",
    "")/. For better or worse, we appear to have committed to allowing
    this. Let's make l.Addr() say the right thing.

    Russ

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 4, '12 at 9:37a
activeOct 21, '12 at 9:24p
posts4
users3
websitegolang.org

3 users in discussion

Mikioh Mikioh: 2 posts Russ Cox: 1 post Iant: 1 post

People

Translate

site design / logo © 2021 Grokbase