Go type checker

Knowledge Videos

Short animated explainers, organised by subject.

Go type checker

Pick a type and a value and see whether Go would accept it, with the compiler's own message.

In Go every variable has a type that is fixed when it is made. An int holds whole numbers, a float64 holds decimals, a string holds text in double quotes, and a bool holds true or false.

If the value does not fit the type, the compiler refuses before the program runs, and its message says what it found and what it wanted.

Things to try

From the videos