Module 2 · Exercise 1 · ~25 min · Real Go code
A working but ugly Go file. Nine specific issues — each maps to a Module 2 lesson concept. Make it idiomatic; the tests must keep passing.
cd module-02-idiomatic-go/exercises/exercise-01-refactor
go test -v ./...
Tests reference NewSubmitter, Submit, ErrTimeout — none of which exist yet. Refactor the starter file until the tests find them.
SubmitterClass stutters and uses Java-isms.DoSubmit has a redundant prefix.this.fmt.Errorf with %w.ErrorTimeout sentinel naming.This is not aesthetic. Each smell maps to a real failure mode:
s is universal in Go for any struct method receiver.%w means callers can't errors.Is anything.Skim the diff. Imagine you're reviewing it. Would you approve? If yes, mark complete and move to Exercise 2 (writing your own table-driven test suite).