Go Programming

Go Programming

A simple, statically-typed, compiled language built for concurrency and fast builds -- from syntax fundamentals through goroutines, channels, and testing.

intermediate12 lessons4 modules6h total

Who it's for

Learners with some prior programming experience (in any language) who want a fast, practical introduction to Go for backend services, CLIs, or cloud tooling.

What you'll be able to do

  • Read and predict the behavior of real Go programs covering variables, control flow, functions, and Go's basic collection types
  • Explain Go's distinctive features: multiple return values, implicit interface satisfaction, and the (result, error) idiom
  • Describe how goroutines and channels provide safe concurrency, and write a basic Go test using the standard `testing` package

Not started — 12 lessons, no account required.

Start this course

Practice this course →Add to a study plan →Interview questions

Go Fundamentals

The toolchain, variables and types, and control flow.

  1. Introduction to Go and the Toolchain

    What Go is, why it exists, and the shape of a minimal Go program.

    15 min
  2. Variables, Types, and Constants

    Declaring variables with `var` and `:=`, Go's basic types, and constants.

    18 min
  3. Control Flow: if, for, and switch

    Go's single looping construct, condition-only if statements, and switch.

    18 min

Functions & Collections

Multiple return values, slices, and maps.

  1. Functions and Multiple Return Values

    Declaring functions, and Go's distinctive support for returning more than one value.

    18 min
  2. Arrays and Slices

    Go's fixed-size arrays, and the far more commonly used, resizable slice.

    20 min
  3. Maps

    Go's built-in hash map type, and the comma-ok idiom for checking key existence.

    18 min

Structs, Interfaces & Errors

Custom types with methods, implicit interfaces, and idiomatic error handling.

  1. Structs and Methods

    Defining custom types with struct, and attaching behavior with methods and receivers.

    20 min
  2. Interfaces

    How Go's implicit, structural interfaces differ from interfaces in most other languages.

    20 min
  3. Error Handling

    Go's explicit `if err != nil` idiom, and why Go has no exceptions for ordinary errors.

    18 min

Concurrency & Project Structure

Goroutines and channels, packages and visibility, and testing with go test.

  1. Goroutines and Channels

    Go's lightweight concurrency primitives, and how channels coordinate them safely.

    25 min
  2. Packages and Exported Identifiers

    How Go organizes code into packages, and its capitalization-based visibility rule.

    15 min
  3. Testing with go test

    Writing a Go test file and reading `go test` output.

    18 min