Small Rustlings-style exercise
runner for learning Go. No external dependencies — everything is stdlib,
so go run . works right after cloning.
Each exercise lives in its own package under exercises/<topic>/<name>/
and comes with:
- a starter
.gofile with a bug, a blank function, or a missing implementation, marked// I AM NOT DONEat the top - a
_test.gofile you're not meant to edit, which defines what "correct" means
go run . run # check exercises in order, stop at the first
# one that needs work (default with no args)
go run . watch # like run, but re-checks automatically every
# time you save a file
go run . list # show every exercise and its status
go run . hint <name> # print a hint for one exercise
go run . solution <name> # print a reference solution for one exerciseor build a binary once: go build -o gorustlings . and run ./gorustlings ....
- Run
go run . watch(orgo run . runand re-run by hand). - It stops at the first exercise that either fails its tests or still
has the
// I AM NOT DONEmarker. - Open the file it points you to (e.g.
exercises/01_variables/variables1/variables1.go), fix the code. - Once its test passes, delete the
// I AM NOT DONEline at the top of the file to mark it complete and move on. - Stuck?
go run . hint <name>. Really stuck?go run . solution <name>.
| # | Topic | Exercise |
|---|---|---|
| 00 | intro | hello |
| 01 | variables | variables1 |
| 02 | types & conversion | types1 |
| 03 | functions | functions1 |
| 04 | control flow | if1 |
| 05 | slices | slices1 |
| 06 | maps | maps1 |
| 07 | structs & methods | structs1 |
| 08 | pointers | pointers1 |
| 09 | interfaces | interfaces1 |
| 10 | errors | errors1 |
| 11 | closures | closures1 |
| 12 | goroutines & channels | goroutines1 |
- Create
exercises/<NN>_topic/<name>/with a starter.gofile (start it with// I AM NOT DONE) and a_test.gofile. - Add an entry to the
exercisesslice in info.go with the package directory, student file name, a hint, and a reference solution. go run . listshould pick it up automatically.