Golang (Go) Tutorial - Variables & Data Types

Unlock Premium Features: AI explanations (Hinglish), Indian voice & Videos
Sign Up Free

๐Ÿ“ฆ Variables Aur Data Types

๐ŸŒŸ Storage Boxes:

๐Ÿ“ฆ Variable = Box (data store karo)
๐Ÿท๏ธ Type = Label (kya type ka data)
๐Ÿ“ Value = Content (actual data)

๐Ÿ“Š Data Types in Go

TypeExampleUse
int25, -10Numbers (whole)
float643.14, 25.5Decimals
string"Hello"Text
booltrue, falseYes/No

๐Ÿ“ Variable Declaration

3 Ways
// Way 1: Full declaration
var name string = "Rohan"

// Way 2: Type inference
var age = 25

// Way 3: Short declaration (most common)
city := "Delhi"

๐Ÿ’ก Go Features:

  • Type inference - Type auto detect
  • := operator - Quick declaration
  • Unused variables = Compile error!

๐Ÿค– AI Tutor Unlock Karo!

Apni language mein coding seekho - Hindi, Marathi, Gujarati aur 10+ Indian languages mein!

  • Hinglish mein explanations
  • Real-life examples
  • Beginner-friendly
Free Signup Karo

Example

name := "Rohan"
age := 25
fmt.Println(name, age)