An open API service indexing awesome lists of open source software.

https://github.com/zhravan/golearn

Small exercises to get you used to reading and writing Go code
https://github.com/zhravan/golearn

awesome-go awesome-golang go golang golearn gopher hacktoberfest hacktoberfest-accepted hacktoberfest2025 learn-go rustlings

Last synced: 8 days ago
JSON representation

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

Awesome Lists containing this project

README

          


logo

GoLearn


Rustlings‑style Go exercises in a tiny CLI.


Join our discord community




### 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+)

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

### Use

```bash
# In any folder, set up exercises here
golearn init

# Or clone a remote exercises repo
# golearn init
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
```

### Contributing

- See [CONTRIBUTING.md](./CONTRIBUTING.md)
- Please follow our [Code of Conduct](./CODE_OF_CONDUCT.md)
- Security issues: see [SECURITY.md](./SECURITY.md)

Need commands?

```bash
golearn help
```

## Makefile shortcuts

```bash
# 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](./LICENSE)
- Non-code lesson content and any included gopher artwork: [CC BY 3.0](./CONTENT_LICENSE).
- Inspired by rustlings and Go by Example. [NOTICE](./NOTICE) for attributions.

## Leaderboard

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

No completions yet. Be the first!