Here is a 100-step roadmap of exercises, categorized by "Belt Level," to take you from zero to architectural hero.

Phase 1: The White Belt (Syntax & Basics)

Focus: Getting comfortable with the "Go way" of doing simple things.

Phase 2: The Yellow Belt (Data & Control)

Focus: Managing data structures and error handling.

Phase 3: The Blue Belt (Interfaces & Engineering)

Focus: Decoupling code and writing testable logic.
  • The Interface: Define a Shape interface with an Area() method.
  • Implementing Interfaces: Create Circle and Square structs that satisfy Shape.
  • Empty Interface: Write a function that accepts interface{} and uses a type switch.
  • Type Assertions: Manually assert that an interface value is a specific struct.
  • Dependency Injection: Pass an interface into a function instead of a concrete struct.
  • Reader Interface: Use io.Reader to read data from a string.
  • Writer Interface: Use io.Writer to write data to a buffer.
  • Decorators: Wrap a Reader to count how many bytes are read.
  • Mocking: Write a unit test for a function by passing in a "mock" interface.
  • Table-Driven Tests: Write a test suite for a calculator using a slice of anonymous structs.
  • Unit Testing: Use the testing package to test a string reversal function.
  • Benchmarking: Use go test -bench to measure the speed of a function.
  • Project Layout: Organize a project into /cmd and /internal folders.
  • Go Modules: Initialize a module and add a 3rd party dependency (e.g., logrus).
  • Environment Variables: Use os.Getenv to configure a mock database URL.
  • Flag Package: Create a CLI tool that accepts a --name argument.
  • I/O Utility: Read an entire file into memory using os.ReadFile.
  • Streaming I/O: Read a massive file line-by-line using bufio.Scanner.
  • Regular Expressions: Validate an email address using the regexp package.
  • Log Levels: Implement a logger that distinguishes between Info, Warning, and Error.
  • Phase 4: The Brown Belt (Concurrency)

    Focus: Master the "Go" in Golang-Goroutines and Channels.

    Phase 5: The Black Belt (Senior/Architect)Focus: Production-grade systems, performance, and internal mechanics.

    How to approach this

    Don't try to do all 100 in a weekend. Go is deceptive; it looks simple, but the "Senior" part comes from understanding why we prefer composition over inheritance and channels over shared memory.

    by Gemini