Proposal Details

An interface value with the type assigned to it (the itable) but without the actual data to use it upon, is not considered as nil. This problem caused me as many unexpected and quite hard to trace problems as the infamous the variables declared by a “for” loop were created once and updated by each iteration. We fixed this one, why shouldn't we move forward.

v := any((*int)(nil))
if v != nil {
    panic()
}

Comment From: gabyhelp

Similar Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: adonovan

This is certainly one of the more confusing things that newcomers to Go have to learn (and it occasionally catches old hands too), but even if we wanted to, there's simply no way we could make this incompatible change to the core semantics of interfaces. A very large number of programs rely on the fact that a nil *int pointer in an any value is non-nil.

Closing as infeasible.