mirror of
https://github.com/golang/go
synced 2024-11-18 16:54:43 -07:00
net/rpc: listen on localhost, let kernel pick port
This avoids a pop-up box on OS X and it avoids a test failure if something is using 5555. I apologize for not noticing this during the review. TBR=r CC=golang-codereviews https://golang.org/cl/152320044
This commit is contained in:
parent
f3eece7492
commit
3492ee5d3a
@ -63,13 +63,13 @@ func TestGobError(t *testing.T) {
|
||||
}()
|
||||
Register(new(S))
|
||||
|
||||
listen, err := net.Listen("tcp", ":5555")
|
||||
listen, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
go Accept(listen)
|
||||
|
||||
client, err := Dial("tcp", ":5555")
|
||||
client, err := Dial("tcp", listen.Addr().String())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user