go-dojo
learn go · earn mastery
phase 1 · 1.2-types-structs

Types, Structs, Interfaces — the Maelstrom node pattern

prereqs 1.1-hello-world0.3-types-zero-values
review intervals 3d 7d 21d 60d drills struct-json-roundtrip

The lesson for this task hasn't been written yet. The mastery criteria below is the shortest description of what you'll own when this task is green.

Mastery criteria

- Build a Message struct with JSON tags, marshal/unmarshal roundtrip clean
- Define a Handler interface {Handle(Message) (Message, error)}
- Implement EchoHandler and ReverseHandler
- Dispatcher routes by "type" field — adding a new handler requires zero dispatcher edits

Verify

Run from your go-dojo repo root:

go-dojo verify 1.2-types-structs

This runs the task's go test suite in exercises/phase-1/1.2-types-structs/, commits the attempt to .go-dojo/attempts/, and updates your mastery.