| ▲ | skydhash 4 hours ago | |
I like go’s approach on having default value, which for struct is nil. I don’t think I’ve ever cared between null result and no result, as they’re semantically the same thing (what I’m looking for doesn’t exist) | ||
| ▲ | onionisafruit 3 hours ago | parent | next [-] | |
In Go, the default (zero) value for a struct is an empty struct. | ||
| ▲ | Cyph0n 3 hours ago | parent | prev [-] | |
Eh, it’s not uncommon to need this distinction. The Go convention is to return (res *MyStruct, ok bool). An Option type is a cleaner representation. | ||