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
- Choose int and type "ten". What does the message say?
- Choose float64 and type 3. Does a whole number fit a decimal type?
- Choose int and type 3.14. Which word in the message explains the problem?
- Find one value that fits each of the four types.