EasyEnv
Engineering/Courses/Catalog/Go/Variables and Types
Go
BeginnerLesson 2 of 2025 min · hands-on

Variables and Types

Part of the Go course

In the last lesson you printed a fixed piece of text. Real programs need to remember things that change: a customer's name, a price, whether a checkbox is ticked. A variable is a name that stands in for a value stored in memory, so your code can refer to "the price" instead of retyping 4.50 everywhere.

Imagine you are filling out a form: one box for a name, one for an age. A variable declaration is that same idea in code, a labeled box that holds one value. Inside a function, the shortest way to create one is the := operator, read as "declare and assign" ...

Want to learn Go Variables and Types in a real environment?

Click below, get a fresh Linux box with Go ready to go, and work through Variables and Types hands-on with an AI tutor that knows your code.

Start this lessonVariables and Types

What you'll learn

  • Var declaration
  • Short declaration :=
  • Int
  • Float64
  • String
  • Bool
  • Type conversion
  • Zero values

Read this lesson in your language

All lessons in this course

20 lessons
  1. 1Hello, Go25 min
  2. 2Variables and Types25 min
  3. 3Control Flow: if and for30 min
  4. 4Functions30 min
  5. 5Slices and Maps35 min
  6. 6Structs and Pointers35 min
  7. 7Methods and Interfaces35 min
  8. 8Error Handling35 min
  9. 9Modules and Project Structure35 min
  10. 10Tiny CLI Capstone40 min
  11. 11A Tour of the Standard Library40 min
  12. 12Testing and Benchmarks40 min
  13. 13Goroutines and Channels40 min
  14. 14Concurrency Patterns45 min
  15. 15Generics35 min
  16. 16HTTP Servers45 min
  17. 17Databases with database/sql45 min
  18. 18Performance and Profiling40 min
  19. 19Design Patterns in Go40 min
  20. 20Deployment and Production45 min

Explore other courses

Variables and Types - Go (English) | Engineering Courses