On Mon, Jul 15, 2013 at 1:01 PM, <
bill...@gmail.com> wrote:
> Why do you like that better than my BroadcastAddress function? I ask
> honestly, I'm not sure,
IPv6 addressing architecture has no broadcast stuff, use multicasting instead.
So your proposed signature net.BroadcastAddress(*net.IPNet) (uint32, error)
looks a bit confusing me.
> and it seems like it doesn't work for IPv6.
You can test address families by using net.IP.TO4() and net.IP.To16().
> Awesome! I didn't see this when I was looking for libraries. I've added it
> to the packages wiki[1], where I had been searching for packages.
Thanks. Actually you reminded me that having ipaddr.py-like package is
not so bad. So I gathered code fragments from old exercise folders and
wrapped them in that package last friday night.
> I suppose that godoc is much more complete than the package wiki? Perhaps
> the link at the bottom of
http://golang.org/pkg/ should be changed from
> pointing to the package wiki to pointing to
godoc.org?
Well, not sure.
> Anyway, I'm going to keep my library around because I want to return uint32
> for IPv4, not big.Int. (Unless you would consider accepting a pull request
> for an IPv4 -> uint32 function for ipaddress? In that case I'd happily
> remove my library).
Having your own package is really nice.
Please keep trying to improve it and happy hacking!
PS: You can use Bits method of ipaddr.Prefix; e.g., p.Bits(0, 32) will return
a 32-bit sequence.