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

Er… similar code in C:

    struct foo bar () {
        return NULL;
    }
is a compilation error as well… (granted it's not an error for strings because C has no strings per-se)


  > (granted it's not an error for strings because C has no strings per-se)
That was kind of the entire point though.


Say what? Your statement is that Go's nil is different than C's null. As demonstrated, it is not, C's null is for pointers and Go's nil is also for pointers.

The difference is that Go has a value-type string and C does not, but that is only a parenthesised aside in your original comment (as an example of Go value types), nowhere near "the point" let alone "the entire point".




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

Search: