On Mon, May 30, 2022 at 6:39 PM Will Faught <w...@willfaught.com> wrote:
>
> Currently, if I understand correctly, there's no expression for the zero 
> value for a type variable:

Thanks for the note.  There is some discussion of this at
https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#the-zero-value
.

> Why not allow nil to be used as the zero value for type variables, to fill 
> this gap?

We could do that.  The main concern is that "nil" is already
overloaded, and people new to Go are frequently confused by it.  See
the FAQ entry https://go.dev/doc/faq#nil_error .  Adding more uses of
nil will increase the potential for confusion.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWXRNfUNCk8E_7cU9dQW-vwNP4%2BBV2Q5VR6a2k4fjQrcA%40mail.gmail.com.

Reply via email to