Skip to Content
Skip to content
Go for Beginners: Write Reliable Programs and Small Services
Beginner
Courses
Go for Beginners: Write Reliable Programs and Small Services

Check Yourself

Five scenario questions on error wrapping, errors.Is, exported identifiers, and table-driven tests.

Course content

Sign in to save your progress.

Course Home
1. `loadConfig` returns `fmt.Errorf("load config %s: %w", path, err)` when `os.ReadFile` fails. Why does `err == os.ErrNotExist` evaluate to false?
2. In package `pricing`, you want callers in `main` to use `ApplyPercent` while keeping `roundCents` internal. How do you express that in Go?
3. You create `pricing/discount_test.go` with unit tests. Will `go build` include those test functions in your production binary?
5. Which format verb in `fmt.Errorf` adds context while still letting callers match the underlying error with `errors.Is`?

About

Five scenario questions on error wrapping, errors.Is, exported identifiers, and table-driven tests.

Duration
5 min
Last update
11/27/2026
Was this helpful?
​ 0 ​ 0

Comments

Sign in to comment

No comments yet.