<p dir="auto">Go version: 1.4</p>
<p dir="auto">The following code works on Windows 7:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package main
import &quot;fmt&quot;
import &quot;net&quot;
func main() {
    ifs, _ := net.Interfaces()
    for _, i := range ifs {
        fmt.Println(i.Flags)
    }
}"><pre class="notranslate"><span class="pl-k">package</span> main
<span class="pl-k">import</span> <span class="pl-s">"fmt"</span>
<span class="pl-k">import</span> <span class="pl-s">"net"</span>
<span class="pl-k">func</span> <span class="pl-en">main</span>() {
    <span class="pl-s1">ifs</span>, <span class="pl-s1">_</span> <span class="pl-c1">:=</span> <span class="pl-s1">net</span>.<span class="pl-en">Interfaces</span>()
    <span class="pl-k">for</span> <span class="pl-s1">_</span>, <span class="pl-s1">i</span> <span class="pl-c1">:=</span> <span class="pl-k">range</span> <span class="pl-s1">ifs</span> {
        <span class="pl-s1">fmt</span>.<span class="pl-en">Println</span>(<span class="pl-s1">i</span>.<span class="pl-c1">Flags</span>)
    }
}</pre></div>
<p dir="auto">Tried both "run as administrator" and "compatibility mode" to see whether this was a side effect but never saw any flags when running on Windows 8.</p>
<p dir="auto">by <strong><a href="mailto:tom.walsh@expresshosting.net">tom.walsh@expresshosting.net</a></strong>:</p>
<pre class="notranslate">The following code returns different results based on the platform:

package main

import (
    "fmt"
    "net"
)

func main() {
    addrs, _ := net.InterfaceAddrs()
    for _, addr := range addrs {
        fmt.Println(addr.String())
    }
}

On Linux it produces:

127.0.0.1/8
192.168.1.10/24
::1/128
fe80::21b:21ff:fe14:3bd3/64

On Windows it produces:

192.168.11.71
 0.0.0.0
 192.168.1.107
 192.168.56.1

Please note the lack of CIDR netmasks


What is the expected output?
Consistent output no matter which platform. I think that including the CIDR is a better
option (Linux has it right, Windows has it wrong)


What do you see instead?
Linux includes the CIDR with the address. Windows omits the CIDR notation.


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g on both platforms


Which operating system are you using?
Linux and Windows


Which version are you using?  (run 'go version')
Windows is 1.1rc1 (also tested with 1.0.2 with the same results), Linux 1.0.3


Please provide any additional information below.</pre>