Part 2 — Tools that talk to systems · wrap-up
Cheat sheet & self-check
6 questions across 3 lessons. Each answer links back to the lesson it came from.
Pick an answer to see if you got it, and why.
Q1. Where should a CLI write its data and its log messages?
Show answer
B. Keeping them apart lets `kaudit nodes | jq` work while warnings still reach the terminal.
From lesson 04 · Building command-line toolsQ2. Why use signal.NotifyContext in a CLI?
Show answer
B. HTTP calls and loops that honour the context stop promptly and can clean up.
From lesson 04 · Building command-line toolsQ3. Why is http.DefaultClient risky in a CLI or service?
Show answer
B. Create your own client with a Timeout, and use contexts for per-request deadlines.
From lesson 05 · HTTP, JSON and APIsQ4. Which failures are usually worth retrying?
Show answer
B. Client errors won't fix themselves; transient server and network errors often do.
From lesson 05 · HTTP, JSON and APIsQ5. You need to check 500 clusters in parallel but at most 20 at a time, stopping everything if a fatal error occurs. What fits best?
Show answer
B. errgroup bounds parallelism, collects the first error and cancels the shared context so the other tasks stop.
From lesson 06 · Concurrency you'll actually useQ6. What is a goroutine leak?
Show answer
B. Leaks build up silently in long-running programs; contexts and buffered or closed channels prevent them.
From lesson 06 · Concurrency you'll actually use