Hands-on practice for go
⭐ If these quests helped you learn Go, please consider starring the repo.
A beginner-friendly set of small Go exercises (“quests”). Each quest is intentionally small so you can practice one Go concept at a time.
You implement functions in .go and confirm correctness with unit tests in _test.go.
Check your Go version:
go versionOption A: Clone with Git (recommended)
Repo:
git clone https://github.com/lite-quests/go-quests.git
cd go-quests # This command helps you go into the quest directory from the terminalOption B: Download ZIP (no Git required)
quests/ — exercises you edit (each quest is a Go package)
quests//README.md — instructions for that quest
quests//.go — your implementation (edit this)
quests//_test.go — tests (do not change)
solutions/ — reference implementations (use to compare after you try)
| # | Topic | Folder | Difficulty |
|---|---|---|---|
| 1 | Hello Go | quests/001.hello_go | Easy |
| 2 | Values | quests/002.values | Easy |
| 3 | Loops | quests/003.loops | Easy |
| 4 | Conditions | quests/004.conditions | Easy |
| 5 | Slice | quests/005.slice | Easy |
| 6 | Maps | quests/006.maps | Easy |
| 7 | Functions | quests/007.functions | Easy |
| 8 | Pointers | quests/008.pointers | Easy |
| 9 | Strings | quests/009.strings | Easy |
| 10 | Structs | quests/010.structs | Easy |
| 11 | Interfaces | quests/011.interfaces | Medium |
| 12 | Enum | quests/012.enum | Medium |
| 13 | Generics | quests/013.generics | Medium |
| 14 | Error | quests/014.error | Medium |
| 15 | Go Routine | quests/015.go_routine | Medium |
| 16 | Channel | quests/016.channel | Medium |
| 17 | Select & Timeout | quests/017.select_timeout | Medium |
| 18 | Tickers | quests/018.tickers | Medium |
| 19 | Worker Pool | quests/019.worker_pool | Hard |
| 20 | Rate Limiting | quests/020.rate_limiting | Hard |
| 21 | Mutexes | quests/021.mutexes | Hard |
| 22 | String Formatting | quests/022.string_formatting | Medium |
| 23 | Regex | quests/023.regex | Medium |
| 24 | Files | quests/024.files | Medium |
| 25 | CLI | quests/025.cli | Medium |
| 26 | Env Vars | quests/026.env_vars | Easy |
| 27 | HTTP Server | quests/027.http_server | Hard |
| 28 | HTTP Client | quests/028.http_client | Hard |
| 29 | Context | quests/029.context | Hard |
| 30 | Logging | quests/030.logging | Medium |
| 31 | Processes | quests/031.processes | Hard |
| 32 | Exit | quests/032.exit | Easy |
| 33 | Signals | quests/033.signals | Hard |
| 34 | JSON | quests/034.json | Medium |
| 35 | Defer, Panic & Recover | quests/035.defer_panic_recover | Medium |
quests/ (start with smaller numbers first)quests//README.md thoroughly. Review all referenced links and documentation to gain a complete understanding of the underlying concept. If the preview does not render correctly, use Ctrl + Shift + V to open the README in preview mode for improved readability.quests/010.structs/structs.gogo test -v ./quests/010.structsRepeat until all tests pass. If stuck, inspect the failing test output first.
Only after you’ve tried: compare with the reference in solutions/.
This repo is designed so that tests teach you the spec: make changes → run tests → refine → repeat.
Don’t print unless the quest asks Tests usually check return values or exact stdout bytes.
Read test failures carefully: they usually tell you the exact edge case you missed.
Avoid changing test files
If tests don’t pass, fix .go (the tests define the requirements).
Disable AI assistance while solving You’ll learn faster if you struggle a bit, read the errors, and look things up in the Go docs. Use AI only after you’ve made a real attempt.
Prefer the intended concept over “test hacks” You might find a workaround that passes the tests, but the goal is to practice the concept the quest is designed to teach (the quest README will usually hint what to use) so please stick to it.
solutions/ contains reference implementations for each quest.fmt.Print vs fmt.Println).go clean -testcacheFor any issues, contact either:
No open issues yet, or sync has not completed.