Gopherlings
📘️ Learn Go by fixing tiny incorrect programs
Install / Use
/learn @soypat/GopherlingsREADME
gopherlings
📘️ Learn Go by fixing tiny incorrect programs
This project was directly inspired by the great ziglings project which itself was inspired by rustlings.
For a first time learner it is suggested you complement this material with another source such as
- Go by example. A lot of material here is based on this project!
- Go go-to guide by yourbasic. Great source for beginners.
- Decaffeinator project which contains the Tagalong document with Python and Go examples side-by-side along with some examples on using Go for creating generative art.
Intended Audience
These exercises will probably be difficult if you've never programmed before.
The exercises should be self-contained and self-explained, though this is a WIP and suggestions are welcome!
Instructions: Running exercises
Requires a Go installation to run the examples.
Instructions using VSCode
-
Download the repository (or alternatively clone it)
-
Install the VSCode Go extension authored by Go Team at Google
-
Open the
gopherlingsfolder in VSCode -
Navigate to the exercise file, i.e.
exercises/001-hello/hello.go -
Once the
hello.gofile is open you may edit it and press <kbd>F5</kbd> to run it. Output will be shown in the Debug Console.
Instructions using terminal
-
Clone repository
git clone https://github.com/soypat/gopherlings.git -
Navigate to example's directory
cd gopherlings/exercises/001-hello -
Edit the file so it is correct and run it with
go rungo run hello.goOptionally, instead of step 3, use
gopherlings watchto auto reload your code after you save your code. Then you will see your code output without any action. You can simply focus on your code.go install github.com/soypat/gopherlings/cmd/gopherlings@latest gopherlings watch gopherlings help # To see other commandsNote: You need to define your
GOBINenvironment variable before runninggo installand add it to yourPATH.GOBINspecifies the directory to which go binaries are installed to.
Roadmap
Short term
- Add quizzes after $n$ exercises.
- Possibly add several quizzes of varying difficulty inside quiz directory.
- Improve the helper program.
- A
hintsubcommand or interactive hints during thewatchcommand. - Allow
runto take an argument that runs a specific exercise. - Add a subcommand to run all exercises and check them against expected output.
- Catch errors that prevent the helper from running exercises (like an incomplete Go installation).
- A
Long term
- Have exercises that cover the entire Go spec.
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
343.3kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
