<pre class="notranslate">Related issues: 4501, 4234

The package net contains some APIs that fetches the kernel state, specifically
network interfaces and its belongings for creating new connections. <a href="https://golang.org/issue/4501" rel="nofollow">issue #4501</a>,
4234 focus on transport API, Dial and Listen, but are not for under the hood API.

This issue holds that how could we support IPv6 scoped address zone support 
for such under the hood API, including whether it should be a part of net API.

API that would be affected:
type IPNet struct
method (*IPNet) String
type IPAddr struct
method (*IPAddr) String
func Interfaces
func InterfaceAddrs
method (*Interface) Addrs
method (*Interface) MulticastAddrs</pre>
<pre class="notranslate"><a href="http://play.golang.org/p/yjqyCAEMyR" rel="nofollow">http://play.golang.org/p/yjqyCAEMyR</a>

What is the expected output?

I expect all examples to listen on an IPv4 address. On the playground this is the case.

What do you see instead?

net.Listen("tcp", "0.0.0.0:11111") listens on [::]:11111 on my
system.

The full output is:
2014/02/25 19:59:14 0.0.0.0:11111
2014/02/25 19:59:14 [::]:11112
2014/02/25 19:59:14 127.0.0.1:11113
2014/02/25 19:59:14 127.0.0.1:11114

Which operating system are you using?

Ubuntu 12.04, 3.8.0-36-generic

Which version are you using?  (run 'go version' or 'gccgo --version')

go version go1.2 linux/amd64

The only reason the examples use different ports is because the playground doesn't
Close() quickly enough for the program to succeed (it works when I Close() locally).
From testing, I don't think port number makes a difference to the behaviour.

Admittedly the workaround is trivial, but I thought this worth reporting anyway.</pre>