On Saturday, 12 September 2020 19:36:18 UTC+1, Andy Hall wrote:
>
> to handle the map not returning a result ( so I don't attempt to 
> write to a non-existent connection ) I need to know the zero value of 
> type net.Conn 
>
>
net.Conn is an interface <https://golang.org/pkg/net/#Conn>, and therefore 
its zero value is "nil".

Note though that you don't need to know the zero value of a type to 
determine whether it's in a map or not. Use the two-value assignment form 
<https://tour.golang.org/moretypes/22> (value, ok := ...) to test if the 
value exists.

Running through the whole of tour.golang.org is highly recommended.  
Several times :-)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9d5c7669-882a-4132-a6bc-8fcbacbd412eo%40googlegroups.com.

Reply via email to