3 ms·
Slight correction > The compiler not only checks for code that can theoretically result in a [logically correct], runnable program... Some examples of this:
by chimeracoder 14y ago
Slight correction
> The compiler not only checks for code that can theoretically result in a [logically correct], runnable program...
Some examples of this:
- If you try to assign to a variable that will never be read, this is a compile-time error.
- If you try to import a module that will never be used, this is a compile-time error.
- If your dependencies don't form a DAG, this is a compile-time error.
Incidentally, not only does this make runtime errors (or logical errors) much less common, it also makes Go code more readable and vastly contributes to its impressive compilation speed.