News for hackers. Stuff that matters.
Re:Things Go needs more than generics by kitd on Monday October 04, 2021 @10:27AM (#28747171)
Similar to a Java Optional<T> [1]

Give it an interface that allows you to attach behaviours for not null and null values.

[1] https://docs.oracle.com/en/java/javase/11/docs/api/java.base...

Re:Things Go needs more than generics by tgv on Tuesday October 05, 2021 @02:48PM (#28763831)
Function passing/callbacks, no thanks. You still won't get a compiler error when passing a potentially nil value, and I'd rather have readable code. I hope Optional is not going to be in the way of progress in this area.