Day 1 — Go Fundamentals: Setup + First Contact
Goal:
Be able to run Go locally, understand the structure of a Go program, and write small working programs.
- Install Go and Verify Tooling
- Install Go from https://go.dev
- Verify installation:
go version
Learn conceptually:
- go run
- go build
- go fmt
- go mod init
Outcome:
- Go is installed and runnable
- You understand the difference between running and building binaries
- Understand a Minimal Go Program
Learn:
- package main
- func main()
- imports
- program entry point
Study:
- Tour of Go:
- Basics
- Packages
- Functions
Write by hand:
package main
import "fmt"
func main() {
fmt.Println("Hello, Go")
}
Outcome:
- You know why Go needs package main
- You know where execution starts
- Core Language Primitives
Learn:
- Variables
- Basic types: int, string, bool
- := short declaration
Practice:
- Declare variables
- Print values
- Modify values
Outcome:
- You can declare and use variables confidently
- You understand static typing at a basic level
- Control Flow
Learn:
- if (no parentheses)
- for (only loop construct)
Practice:
- Loop from 1 to 10
- Print even or odd
Outcome:
- You can read and write Go control flow
- Mini Project: Number Guessing Game
Requirements:
- Generate a number
- Read user input
- Compare guess
- Loop until correct
You will use:
Outcome:
- First non-trivial Go program completed
- Formatting Discipline
Run:
go fmt .
Learn:
- Go enforces one official format
- Formatting is non-optional
End-of-Day Checklist
- Go installed and working
- Understand package main and main()
- Variables and basic types used
- if and for written
- At least one working program
- go fmt used
If any item fails, repeat Day 1.