Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In Go nil is a special identifier that represents a "zero value" for several types

I think this is the crux of the problem. OP's confusion would be addressed by

    var foo someType = someType.nil
    var bar someInterface = foo
    if (bar == interface.nil) // prints false without confusion


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: