Skip to content

kush1jpeg/golearn

 
 

logo

GoLearn

Rustlings‑style Go exercises in a tiny CLI.


Why this exists

This project is my attempt to learn Go by building as I learn, making the journey more engaging while exploring the language in practice. I'm sharing the exercises and tooling so others can learn alongside me.

At a glance

  • Simple CLI to list and verify exercises
  • Helpful hints and solution links when you're stuck
  • Watch mode to auto-run tests on changes
  • Progress dashboard with a visual bar and checklists
  • Publish your progress to GitHub and appear on the README leaderboard

Install (Go 1.22+)

go install github.com/zhravan/golearn/cmd/golearn@latest

Use

# In any folder, set up exercises here
golearn init

# Or clone a remote exercises repo
# golearn init <repo-url> <dir>
golearn init https://github.com/your-org/your-exercises my-exercises
cd my-exercises

# Learn
golearn list
golearn verify 01_hello
golearn hint 01_hello
golearn solution 01_hello   # Suggests hints; else prints GitHub link
golearn verify 01_hello --solution  # Run tests against the embedded solution
golearn progress    # Rich TUI with ASCII progress bar and checklist

# Auto-verify on change (watch mode)
golearn watch       # Watches ./exercises and re-runs tests per edited exercise

# Publish your progress (appears on README leaderboard)
golearn publish --dry-run
golearn publish --user <github-username>

Contributing

Need commands?

golearn help

Makefile shortcuts

# Show help
make

# Run commands
make list
make verify NAME=01_hello
make progress
make watch

Tips

  • The progress bar adapts to terminal width via the COLUMNS env var.
  • Press Ctrl+C to stop watch mode.

Licensing and Attribution

  • Code: MIT
  • Non-code lesson content and any included gopher artwork: CC BY 3.0.
  • Inspired by rustlings and Go by Example. NOTICE for attributions.

Leaderboard

The following users have completed all exercises (ascending by completion time):

No completions yet. Be the first!

About

Small exercises to get you used to reading and writing Go code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.9%
  • Makefile 3.1%