Advanced Go, with explicit boundaries
Concurrency, cancellation and resource ownership become easier to reason about when each operation has a visible contract. Start from a concrete workload, not a checklist of language features.

Concurrency is a design tool
A goroutine lets a function proceed concurrently with other work. It does not guarantee that a program is faster, that each goroutine runs in parallel, or that a race is impossible. Begin by asking which operations must overlap and what bounds the amount of work. A service that starts one unbounded goroutine for every slow request can exhaust resources even when each function looks simple. Use a sequential implementation as a reference and measure the real workload before choosing a more complex arrangement.
Give every worker a stopping rule
Decide who starts a worker, who waits for it and what makes it finish. A context can carry cancellation and a deadline across API boundaries; the worker must still observe cancellation where it blocks. Do not store a request context indefinitely in a long-lived object. Pass the context explicitly to operations that use it. Cancellation is a request to stop, not a replacement for waiting until cleanup completes. A useful review question is whether every path, including an early error, releases the resource it owns.
Channels communicate; locks protect invariants
Choose a channel when a message or ownership transfer makes the design clearer. Choose a mutex when several operations need a simple shared invariant. Neither mechanism is automatically more idiomatic in every situation. Document which component closes a channel and when receivers can expect completion. Sending to a closed channel panics; receiving after the buffered values are drained returns the zero value with an indication that the channel is closed. These are protocol rules, not incidental details.
Test the races you can exercise
Run go test -race ./... on a supported environment to help detect unsynchronized access in the execution paths covered by the tests. The race detector is dynamic: a clean run does not prove that an unexercised path is safe. Add a focused test for cancellation and an error from one worker while another is still running. Avoid tests that depend on a fixed sleep to make the scheduler behave in a particular order; synchronize on a visible event instead.
Measure before rewriting
A benchmark answers a particular question under particular conditions. Record the input, allocation behavior, Go version and machine context when comparing results. If latency comes from a remote service, rearranging a local loop may not change what a user experiences. Use a profile to locate actual CPU or allocation costs before introducing pooling, caching or a worker scheduler. A cache adds invalidation and memory-lifetime questions that should be part of the design, not an afterthought.
Keep the boundary small
Expose the minimum behavior the caller needs. If a function only needs to read bytes, accepting a reader may be clearer than accepting a complete service client with unrelated methods. Avoid introducing a generic abstraction solely because two snippets look alike. Distinct domain rules can deserve distinct code. Review one boundary at a time: input validation, timeout, error reporting, ownership and the observable result. The goal is code that can be explained and tested, not the shortest possible signature.
A small command checklist
go test ./... go test -race ./... go test -bench=. -benchmem ./...
Run these commands in the intended module folder. Check your installed Go version and the official documentation when an option differs from an example.