Closed
Description
It's confusing that nil can be used both as a value to represent an uninitialized interface, and as a value for the pointer that an interface is initialized with. It's also very inconvenient to determine whether a pointer value in an interface is nil without casting it to the pointer type.
Proposal: use a value other than nil for uninitialized interfaces. To avoid adding new pre-defined identifiers, the value could be syntactically represented as {}, for example. This would allow expressing tests like this:
var v interface{}
...
if (v != {}) && (v != nil) {
...
}
The test against nil then doesn't need a cast and doesn't need to use the reflect package.