Go / Basic: Values and Program Contracts

Go β€” Basic: Values and Program Contracts

Read, run, and reason about small Go programs and their data.

6 lessons Β· No account required

What you will learn

  • Create and inspect a small standard-library module.
  • Trace values, control flow, collections, and method calls.
  • Distinguish successful results from explicit errors.
  1. Tooling, Modules, and the Program Model

    Follow a Go program from package source to an executable, and record language and toolchain choices explicitly.

    Start learning
  2. Types, Zero Values, and Conversions

    Choose representations deliberately and explain what a variable contains before an explicit initializer is supplied.

    Start learning
  3. Functions and Control Flow

    Turn calculations into small contracts and justify branches, loops, and deferred cleanup from explicit rules.

    Start learning
  4. Arrays, Slices, and Text Boundaries

    Track length, capacity, backing storage, and text units instead of treating every sequence as an independent copy.

    Start learning
  5. Maps, Structs, and Data Invariants

    Choose keyed lookup and records deliberately, and preserve invariants without inventing map ordering or deep-copy guarantees.

    Start learning
  6. Methods, Interfaces, and Errors

    Use small behavioral contracts and explicit errors while keeping dynamic type, dynamic value, and nil distinct.

    Start learning
Back to course