Nobody has started this yet — be first.
Business impact
Builder.Build() returns (*Machine, error). Every current caller in this repo (payment.BuildMachine, the library's own tests, the order-fulfillment example) either propagates that error or handles it explicitly -- reasonable for a caller that takes user-configurable durations and can genuinely fail at runtime. But a caller with a fully static, compile-time-fixed table has no real recovery path for a "build error" other than to panic anyway -- except right now they'd have to write that panic themselves.
Problem
There is no Builder.MustBuild() convenience -- every caller with a statically-known-correct table has to write its own three-line "call Build, panic on error" wrapper.
Current behavior
Calling the not-yet-implemented Builder.MustBuild panics unconditionally (a stub), even for a perfectly valid table.
Expected behavior
Builder.MustBuild() *Machine -- behaves exactly like Build, except it panics (with the underlying error's message) instead of returning an error, for callers who know their table is correct and want to fail loud at startup rather than thread an error through.
Steps to reproduce
machine := statemachine.New("x").State("a").State("b", statemachine.Terminal()). Transition("a", "go", "b", nil, nil).MustBuild() // currently panics even though this table is perfectly valid
Why this matters
This is a small but genuine ergonomic gap in the reusable library: the "panic on a startup-time, should-never-actually-happen error" pattern is common enough (regexp.MustCompile, template.Must) that not offering it forces every such caller to reimplement the same three lines.
Suggested approach
Look at how Build() is implemented -- MustBuild should call it and panic on a non-nil error, returning the *Machine otherwise. This is a thin wrapper; don't duplicate any of Build's validation logic.
Acceptance criteria
Verification
go test ./tickets/tests/... -run TestTicket14 -v
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
Sign in to create it automatically, or do it yourself:
$git checkout -b feat/builder-mustbuildFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin feat/builder-mustbuildSubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign indocker composepaystate/paystate/go.modreplace reliable => ../reliabledocker compose up --buildpaystate/context: ..docker-compose.ymlCREATED_TIMEOUTAUTHORIZED_TIMEOUTWork the tickets in tickets/docs/ (ticket-01 through ticket-25); each names one Go test in tickets/tests/:
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket01 -v # a single ticket
TEST_DATABASE_URL=postgresql://... ./tickets/run_tickets.sh # all 25, clean pass/fail summary
Tickets that don't touch Postgres (02, 03, 04, 05, 06, 14, 15, 24) run fine without TEST_DATABASE_URL set; the rest report FAIL with a "TEST_DATABASE_URL not set" message if it's missing. make test-race runs the full go test -race -p 1 ./... suite the same way.
Level 2
Implement a feature
Extend the system within its own patterns.