1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
9 func TestTCP4ListenZero(t *testing.T) {
10 l, err := Listen("tcp4", "0.0.0.0:0")
15 if a := l.Addr(); isNotIPv4(a) {
16 t.Errorf("address does not contain IPv4: %v", a)
20 func TestUDP4ListenZero(t *testing.T) {
21 c, err := ListenPacket("udp4", "0.0.0.0:0")
26 if a := c.LocalAddr(); isNotIPv4(a) {
27 t.Errorf("address does not contain IPv4: %v", a)