Go 101 — Fundamentals
What you’ll learn
Section titled “What you’ll learn”This module covers the essential building blocks of Go from the perspective of a working TypeScript developer. Each lesson anchors a Go concept in something you already know, then shows you the Go way.
- Variables —
let/const→:=, zero values vsundefined - Functions — signatures, multiple returns, named returns, variadics
- Control Flow —
if, the oneforloop that does everything,switch,range - Collections — arrays vs slices, maps (Go’s version of JS objects/Map)
- Structs & Methods — value types, receivers (Go’s answer to classes)
- Interfaces — implicit satisfaction (structural but explicit — like TS, but different)
- Errors — errors as values, not exceptions
- Packages — Go modules, exported identifiers, imports
Your first comparison
Section titled “Your first comparison”In TypeScript you probably write this every day:
const greet = (name: string): string => { return `Hello, ${name}!`;};console.log(greet("World"));In Go the same idea looks like:
package main
import "fmt"
func greet(name string) string { return fmt.Sprintf("Hello, %s!", name)}
func main() { fmt.Println(greet("World"))}A few things jump out immediately: explicit package main, no arrow functions, fmt for formatted output, and types come after parameter names. All of these will feel natural by the end of this module.