3 ms·
I agree; I want non-nillable types in Go. This despite the differences in Go that makes nil values more "valid" than they often are in other languages. I still
by jerf 10y ago
I agree; I want non-nillable types in Go. This despite the differences in Go that makes nil values more "valid" than they often are in other languages.
I still faintly hold out hope. Unlike many of the complaints about Go that would require fundamental restructuring, C# showed that actually can be retrofitted onto a language without breaking it.
- pcwalton 10y ago> Unlike many of the complaints about Go that would require fundamental restructuring, C# showed that actually can be retrofitted onto a language without breaking it. C# added nullable types. Not non-nullable types. In Go, the concept of zero values is so fundamentally baked into the semantics that non-nil pointers can never really be added to it.
- stcredzero 10y agoI'd just make my own uninitialized type in Go. In fact, I think I've done it. I'd guess you'd want to avoid the boilerplate.