On Tue, Oct 31, 2017 at 7:25 AM,  <oju...@gmail.com> wrote:
>
> Not being able to test for a nil interface is a Go language bug.
>
> Humans are fallible, so are our projects. Every project has its share of
> errors.
> Go, despite being a great tool we all love, is no exception to that
> universal rule.

Agreed about fallibility and errors, but Go is a programming language
so it's necessary to be precise.  Go makes it straightforward to test
for a nil interface value: write `v == nil`.  What you are talking
about is something different: testing whether an interface holds a
value of some type, where the value of that type happens to be nil.
Go makes a clear and necessary distinction between an interface that
is nil and an interface that holds a value of some type where that
value is nil.  It would be a mistake to remove that distinction, and
once you accept that it's hard to see what we can do.  See also
https://golang.org/doc/faq#nil_error .

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