Variables & Data Types (var, :=, const, Zero Values) - Go Tutorial for Beginners #2 -
6views
004:30
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Learn how to work with variables and data types in Go! š
In this lesson, you will learn:
ā
Declaring variables with var keyword
ā
Short declaration with := operator
ā
Type inference in Go
ā
Constants with const
ā
Understanding zero values
ā
Basic types: string, int, float64, bool
š Timestamps:
0:00 - Introduction
0:24 - Variable Declaration with var
1:04 - Short Declaration with :=
1:44 - Constants
2:25 - Zero Values
3:05 - Recap
3:35 - End
š» Source Code: https://github.com/GoCelesteAI/go_variables
š Code from this lesson:
// Explicit declaration
var name string = "Alice"
var age int = 25
// Short declaration (type inference)
name := "Bob"
age := 30
// Constants
const Pi = 3.14159
const AppName = "MyApp"
// Zero values
var count int // 0
var message string // ""
var flag bool // false
š Previous: Lesson 1 - Introduction to Go
š Next: Lesson 3 - Strings & Formatting
#Go #Golang #GoTutorial #LearnGo #Programming #Variables #DataTypes #GoProgramming