3 ms·
Optionals are a way of returning either result or an error, and are not similar to interfaces. Go works around this by providing multiple return values, but bec
by ntonozzi 11y ago
Optionals are a way of returning either result or an error, and are not similar to interfaces. Go works around this by providing multiple return values, but because it lacks generics, it is very common to manually check for errors.
I'm not sure about Swift, but in some languages you can statically check case statements to make sure that every enum has a case, which is not possible with Go.