Skip to content

Guide · Open source

How to use 7days-golang: clone, build and learn from 4 mini projects

Updated · written with AI from the project's own documentation and checked against our catalogue data

7days-golang is an MIT-licensed set of Go code examples that builds small projects from scratch, one feature per day. It covers a gin-like web framework (Gee), a groupcache-like distributed cache (GeeCache), a gorm- and xorm-like ORM (GeeORM), and an RPC framework based on net/rpc (GeeRPC). After this guide you will know how to get the code, where each day's material lives, and how to read the course in order.

7days-golanggeektutu/7days-golang · ★ 17k · MIT

Quick start

  1. 1Check your Go setup. Install a recent Go toolchain and confirm it runs. The README does not name a minimum version.
  2. 2Clone the repository. Run git clone https://github.com/geektutu/7days-golang to download all the projects and articles.
  3. 3Pick one project. Start with gee-web if you want to understand web frameworks, or gee-cache, gee-orm or gee-rpc for the other topics.
  4. 4Read day 1. Open the linked day 1 article and its code folder to see the starting point of the project.
  5. 5Move through the days in order. Compare each day's folder with the previous one so you see exactly which feature was added.
  6. 6Experiment. Modify a small part of a day's code and observe what changes, which is how the README suggests the material is best learned.

What you need before you start

The README says the course assumes you already know basic Go syntax. It recommends reading the separate Go 语言简明教程 (a quick Go tutorial by the same author) first if you are not yet comfortable with the language.

The README does not state which Go version is required, so use a recent Go toolchain and check the code folders for any build notes.

  • Basic Go syntax (functions, structs, interfaces, goroutines)
  • Git, to clone the repository
  • A Go toolchain installed on your machine

Get the code with git clone

The only install step listed in the README is cloning the repository. This project is a set of learning examples, so there is no installer or package to add to an app.

After cloning, open the folder and browse the four project directories: gee-web, gee-cache, gee-orm and gee-rpc, plus demo-wasm for WebAssembly examples.

git clone https://github.com/geektutu/7days-golang

Follow one project day by day

Each project is split into seven days. Every day has a written article on geektutu.com and a matching code folder in the repo. Read the article for the idea, then open the folder to see the code that implements it.

Each day adds one feature on top of the previous one. For Gee, the days run from the http.Handler interface (day 1) through Context, Trie-tree routing, Group control, Middleware, HTML templates and panic recovery (day 7).

  • Gee web framework: days 1 to 7 in gee-web, with folders such as day3-router and day5-middleware
  • GeeCache distributed cache: days 1 to 7 in gee-cache, from LRU eviction (day1-lru) to Protobuf communication (day7-proto-buf)
  • GeeORM: days 1 to 7 in gee-orm, from database/sql basics to migration (day7-migrate)
  • GeeRPC: days 1 to 7 in gee-rpc, from message codec (day1-codec) to registry (day7-registry)

Run and modify the examples

The README links each day to a code folder but does not give per-project run commands, so check each folder for its own files and instructions. A good way to learn is to compare two consecutive days, see what changed, and then try to change a behaviour yourself.

The WebAssembly demos (hello-world, register-functions, manipulate-dom, callback) are separate from the four main projects and are explained in the Go WebAssembly 简明教程 linked from the README.

  • Read the day's article first, then the diff with the previous day's folder
  • Change one piece, such as the eviction policy in day1-lru, and observe the effect
  • Use the Chinese README section if you read Chinese; the English section covers the same days

Know what this project is not for

These are teaching projects. The README presents them as code that shows concepts, not as production libraries. If you need a dependable library inside an application, use an established project such as gin, groupcache, gorm or go-zero.

The README lists no releases, so do not treat the repository as a versioned dependency to import.

  • Do not import these packages into a production service
  • Use them as reference reading to understand how the real libraries work

What people use it for

  • Understanding how a router, middleware chain or context object works inside a web framework
  • Learning how an LRU cache, consistent hashing or single-flight protects a cache from load spikes
  • Seeing how a small ORM maps Go structs to database tables and runs transactions and migrations
  • Studying how net/rpc can be extended with a codec, timeouts, HTTP support and service discovery
  • Practising Go design for technical interviews that ask about internals

Frequently asked questions

Is 7days-golang free to use?

Yes. The project is licensed under MIT, as shown in the README badge. The MIT licence allows reuse under its terms, but the README describes these projects as teaching material rather than production libraries.

How do I install 7days-golang?

The README gives one install step: clone the repository with git clone https://github.com/geektutu/7days-golang. There is no package installer listed.

What Go version do I need?

The README does not specify a Go version. It only lists Go as the prerequisite, so use a current Go toolchain and check the individual folders for any requirements.

Can I use 7days-golang in a production app?

No, the project is built to show concepts rather than to be used in production. For production, the README points to established libraries of the same kind, such as gin for web, groupcache for caching, gorm for ORM and go-zero for services.

Is 7days-golang a good alternative to gin or gorm?

It is not a replacement. It is a learning project that re-implements ideas from gin, groupcache, gorm and xorm in a small codebase. Use the real libraries to build software and this project to understand how they work.

Is 7days-golang suitable for beginners?

Not for complete beginners to programming. The README assumes familiarity with Go and recommends the separate Go 简明教程 first. It suits readers who already know basic Go syntax.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

7days-golang suits Go developers, students and interview candidates who want to read small, step-by-step implementations of a web framework, cache, ORM and RPC library. It is not suitable for production use, for complete programming beginners, or for anyone who needs a maintained framework with releases; choose gin, groupcache, gorm or go-zero for those.

Install options & downloads