Runtime Errors
This page specifies the runtime error model of the language.
A runtime error terminates evaluation of the program with an implementation-defined diagnosis. No further evaluation of the program occurs.
The runtime error conditions defined by the language are:
- integer division or remainder by zero,
- an out-of-range slice subscript, and
- an out-of-range or inverted slice subslice.
The compiler inserts a runtime check at every expression which may produce a runtime error, unless it can prove that the error cannot occur.