Skip to content

7days-golang

A tutorial series that builds a web framework, cache, ORM, and RPC library from scratch in Go.

Stars
17k
Forks
2.6k
Licence
MIT
Language
Go
Last update
2 months ago
Type
Learning resource

What it is

This is a set of Go code examples organized as a 7-day build-along course. Each day adds one feature to a small project, such as a web framework similar to gin, a distributed cache similar to groupcache, an ORM similar to gorm and xorm, and an RPC framework based on net/rpc. Each day links to a written explanation and a code folder so you can see how the pieces fit together.

  • Read the Gee web framework code day by day to see how routing, context, middleware, and templates are built
  • Study the GeeCache code to learn LRU eviction, consistent hashing, and single-flight request deduplication
  • Work through the GeeORM days to see how struct-to-table mapping, hooks, transactions, and migrations are implemented
  • Run the WebAssembly demos to learn how Go code can manipulate the browser DOM

Great for

  • Developers who want to understand how web frameworks, caches, ORMs, or RPC libraries work internally
  • Students learning Go who prefer reading and running small, step-by-step code
  • Engineers preparing for interviews that cover Go internals
  • Readers who already know basic Go syntax and want to practice designing small libraries

Not ideal for

  • People who need a production library to use in an app, since these are teaching projects built to show concepts rather than to be used in production
  • Complete beginners to programming, because the README assumes familiarity with Go and linking to a separate basics tutorial is recommended
  • People looking for a maintained, feature-complete framework with releases, since the README lists no release
Step-by-step guide: how to use 7days-golangInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    You'll need: Go (version not specified in the README)

    Clone the repository

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

    Run it

    • Clone the repository with git.
    • Open the folder for the part you want, such as gee-web or gee-cache.
    • Read the linked day explanation on geektutu.com for that day.
    • Open the day's code folder and read or run the example code.
  3. 3

    Get the most out of it

    • Read the linked written explanation for each day alongside the matching code folder
    • Compare each day's code with the previous day to see exactly what changed
    • Start with the Gee web framework, which the README presents first
    • Read the recommended Go basics and interview question articles linked in the README if you need background

Downloads

Strengths

  • Breaks each system into seven small, sequential steps with a linked explanation and code folder for each
  • Covers several distinct areas of backend work (web routing, caching, databases, RPC) in one place
  • Available in both English and Chinese versions of the README

Trade-offs

  • The README does not state a specific Go version or describe how to run the code, so setup details are unclear from this text
  • The projects are educational re-implementations and the README does not claim they are production-ready
  • The README is truncated here, so some details about individual days could not be verified

How it compares

ProjectStarsTypeLevelUpdatedBest for
7days-golang (this)17kLearning resourceintermediate2 months agoDevelopers who want to understand how web frameworks, caches, ORMs, or RPC libraries work internally
gin89.5kLibraryintermediate27 days agoGo developers building REST APIs
gorm40kLibraryintermediate13 days agoGo developers building web services or APIs that store data in a relational database
go-zero33.4kLibraryintermediate5 days agoGo developers building REST APIs or microservices
night12.3kLearning resourcebeginner2 months agoGo developers who want to deepen their understanding of the language and its source code
SpringAll28.9kLearning resourcebeginner2.4 years agoDevelopers who read Chinese and want to learn Spring Boot step by step

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.