Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gopherlings

> 编程语言
Open source

️ Learn Go by fixing tiny incorrect programs

736 stars0 likes0 views
WebsiteGitHub

About

️ Learn Go by fixing tiny incorrect programs

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

  1. Download the repository (or alternatively clone it)

  2. Install the VSCode Go extension authored by Go Team at Google

  3. Open the gopherlings folder in VSCode

  4. Navigate to the exercise file, i.e. exercises/001-hello/hello.go

  5. Once the hello.go file is open you may edit it and press F5 to run it. Output will be shown in the Debug Console.

Instructions using terminal

  1. Clone repository

    bash
    git clone https://github.com/soypat/gopherlings.git 
  2. Navigate to example's directory

    bash
    cd gopherlings/exercises/001-hello
  3. Edit the file so it is correct and run it with go run

    bash
    go run hello.go

    Optionally, instead of step 3, use gopherlings watch to 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.

    bash
    go install github.com/soypat/gopherlings/cmd/gopherlings@latest
    gopherlings watch
    gopherlings help  # To see other commands

    Note: You need to define your GOBIN environment variable before running go install and add it to your PATH. GOBIN specifies 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 hint subcommand or interactive hints during the watch command.
    • Allow run to 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).

Long term

  • Have exercises that cover the entire Go spec.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goexamplesexamples-gofix-the-codego

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言