2 ms·
Go does indeed add some nice checks over C. For example, given: type foo int var ( A foo = iota B C D ) func bar(x foo)
by jrockway 13y ago
Go does indeed add some nice checks over C. For example, given:
type foo int
var (
A foo = iota
B
C
D
)
func bar(x foo) ...
It's an error to write:
bar(2)
That's enough typing to prevent many types of annoying mistakes.