25 lines697 B

Lesson 7: Context and timeouts

In this lesson you'll work through context and timeouts step-by-step, with short exercises after each idea.

Full lesson: https://glibcode.net/courses/go-apis/lessons/7

Files

  • main.go: a request context with a deadline

Tip: go doc net/http.HandlerFunc shows the docs without leaving the terminal.

Tip: go vet ./... catches mistakes the compiler allows.

Tip: Run gofmt -w . before committing; nobody argues about formatting in Go.

Run it

go run ./lessons/07-context-and-timeouts

Exercises

See exercises.md. Ask in the forum once you've tried.