Learn Go: Variables and Formatting
Learn about creating and storing values in Go by using variables. Use different types to indicate what values those variables store.
StartKey Concepts
Review core concepts you need to learn to master this subject
Go Values
Go Data Types
Go Variables
Go Errors
Go Strings
Go Zero Values
Go Inferred Int Type
Go Updating Variables
Go Values
Go Values
// literal unnamed value
fmt.Println("PI = ", 3.14159)
// constant named value
const pi = 3.14159
// variable named value
var radius = 6
In Go, values can be unnamed or named. Unnamed values are literals such as 3.14
, true
, and "Codecademy"
. Named values have a name attached to the value and they can either be unchangeable as constants or changeable as variables once defined.
Learn Go: Variables and Types
Lesson 1 of 2
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory