Just to be sure we are saying the same things, I am saying that the 
programmer should be getting the interfaces for the network and walking 
them looking for the interface with the address they are interested in, and 
getting the IPMask for that interface. Alas, this is harder than it might 
be, you have to use a type switch to get the mask since what the 
net.Interfaces() gives you is a *net.Addr while the mask is part of the 
implementation, *net.IPNet. As it stands, a new programmer might think 
DefaultMask() is what should be called.

On Thursday, March 7, 2019 at 7:49:20 PM UTC-5, Ian Lance Taylor wrote:
>
> On Thu, Mar 7, 2019 at 2:42 PM John Dreystadt <jdrey...@gmail.com 
> <javascript:>> wrote: 
> > 
> > I have not seen any response to my last posting yet, and I think it is 
> still an open question. I also realized an additional point that I should 
> have pointed out before which is that this is an IPv4 only thing. Which 
> means that I really don't understand when you would use this function. 
> Would it make sense to poll the golang-nuts community to see who is using 
> this call and what for? Other than to determine if an address is IPv4, when 
> To4() should be used instead. 
>
> I think you are basically recommending that we add a sentence to the 
> DefaultMask method docs saying that you should probably be using an 
> IPMask?  That sounds reasonable to me. 
>
> Ian 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to