Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

  1. integer division or remainder by zero,
  2. an out-of-range slice subscript, and
  3. 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.