News for hackers. Stuff that matters.
Re:Reusable and type-safe options for Go APIs by ctz on Sunday October 22, 2017 @08:12AM (#15526453)
That's problematic, thanks to golang choosing to have always-nullable reference types. "option T*" would therefore be a tristate type, unless it was somehow specialised into representing nullability (obviously a major breaking change).
Re:Reusable and type-safe options for Go APIs by weberc2 on Sunday October 22, 2017 @08:19AM (#15526482)
If mostly everyone uses Option instead of `nil`, the problem approaches a vanishing point. Not perfect, but still a massive improvement. Of course, generics won't be added until Go 2 anyway, at which point the community is free to make a breaking change, though I doubt they'll ditch `nil`.