goatlang / goat

Extended flavor of the Go programming language, aiming for increased value safety and maintainability
MIT License
63 stars 1 forks source link

Strict Nil Checks #2

Open avivcarmis opened 2 years ago

avivcarmis commented 2 years ago

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.

qrhfz commented 1 year ago

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

StephanSchmidt commented 11 months ago

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 )