Re:Go nulls and SQL
by ricardobeat on Monday May 23, 2022 @08:23PM
(#31486544)
No you can't, but Go will happily de-reference the pointer without a null check, and your "string" will blow up in production: https://go.dev/play/p/7EVa7q6VgIM
The distinction between pointer and optional is not vast. The distinction between pointer and not optional is.
The whole idea of optional is to make not optional possible.
You can call a value method on a nil pointer and it panics, though, which I think was a mistake.
Re:Go nulls and SQL
by nemothekid on Tuesday May 24, 2022 @02:09AM
(#31488575)
>The distinction between pointer and optional is not as vast as people make it out to be.
The billion dollar mistake is overblown?
(But thanks, I overlooked T? conversions inside if.)