We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

The Compilation Process

Computers need machine code, they don't understand English or even Go. We need to convert our high-level (Go) code into machine language, which is really just a set of instructions that some specific hardware can understand. In your case, your CPU.

The Go compiler's job is to take Go code and produce machine code, an .exe file on Windows or a standard executable on Mac/Linux.

Two Kinds of Errors

Loosely speaking, there are two kinds of errors in programming:

  1. Compilation errors happen when the code is compiled. They're the good kind: a program with a compiler error won't build, so it can't ship to production.
  2. Runtime errors happen while the program is running. They're worse because they can crash a program that's already in use.

In the browser we compile and run in one step, so you'll see both kinds in the same output panel.

Assignment