goat icon indicating copy to clipboard operation
goat copied to clipboard

Strict Nil Checks

Open avivcarmis opened this issue 3 years ago • 2 comments

Do we want to go with the direction of Swift, Kotlin, and TypeScript with nullable types?

Or the direction of Rust and Scala with Option type?

More context in this blog post section.

avivcarmis avatar Aug 08 '22 12:08 avivcarmis

i vote for nullable types like in ts, kotlin, dart. with '?' and '??' operator.

qrhfz avatar Jan 26 '23 11:01 qrhfz

What fits best into Go IMHO would be a Zig approach.

!int for an error result (short for (int, error)) ?int for a nullable result

( prefix modifiers like []int )

StephanSchmidt avatar Sep 01 '23 05:09 StephanSchmidt