Skip to content

Primitive Types

Beginner · Fundamentals

Go’s built-in types: booleans, numeric types (int, int8…64, uint…, float32/64, complex), byte (alias for uint8), rune (alias for int32), and string. Conversions between numeric types must be explicit.

Toggle a boolean before the second check.

Show hint
Update the code to reflect the store closing before the second check.

Source

Declare the string before formatting it.

Show hint
Make sure 'who' is declared and assigned a value before using it.

Source

Declare the variables passed to Printf.

Show hint
fmt.Printf() can take multiple variables as parameters. Try declaring those variables.

Source

Store a character in a byte value.

Show hint
byte can hold values from 0 to 255. Could it store a character?

Source

Use Go’s real numeric type names.

Show hint
These names seem misleading, no? But they are close to being correct.
Check this documentation to understand the variety of
numeric data types: https://go.dev/ref/spec#Numeric_types

Source