A hands-on Go learning repository for language fundamentals, data structures, algorithms, concurrency, testing, and engineering practice.
This repository is not just a collection of code snippets. It is a runnable learning path that helps readers move from Go beginner to Go engineering expert. The route starts with language mechanics, continues through data structures and algorithms, and then moves into concurrency, testing, design patterns, Web demos, tooling, and performance awareness.
- Build a practical path from Go fundamentals to expert-level engineering habits.
- Use data structures and algorithms as the training ground for pointers, invariants, tests, and complexity analysis.
- Borrow navigation ideas from mature learning repositories such as TheAlgorithms/Python, while keeping a Go engineering focus.
- Keep every major topic connected to code, tests, practice tasks, and next-step guidance.
| Reader | Suggested entry |
|---|---|
| New Go learner | Start with BasicGo/ and Beginner to Expert. |
| Developer from another language | Read the Knowledge Graph and skip concepts you already know. |
| Algorithm learner | Start with Linked/, Sorts/, Graph_algo/, and DIRECTORY.md. |
| Backend engineer | Focus on concurrency, context, testing, design patterns, webdemo/, and the Expert Track. |
Requires Go 1.22 or newer.
go vet ./...
go test ./...Run one topic only:
go test ./BasicGo/pointers
go test ./DoubleLinked -run TestFIFO
go test ./Graph_algo/search| Stage | Goal | Recommended modules | Completion signal |
|---|---|---|---|
| Stage 1 Beginner | Learn syntax, functions, pointers, structs, interfaces, errors, and tests. | BasicGo/ |
You can modify basic examples and write table-driven tests. |
| Stage 2 Intermediate | Understand goroutines, channels, select, context, shared variables, and race thinking. |
BasicGo/GoRoutine, BasicGo/channelselect, BasicGo/context, BasicGo/sharedvars |
You can explain data flow and synchronization boundaries. |
| Stage 3 Advanced | Master linked lists, stacks, queues, heaps, trees, graphs, sorting, union-find, Trie, and SkipList. | Linked/, Heap/, Graph_algo/, Sorts/ |
You can test invariants and explain complexity tradeoffs. |
| Stage 4 Expert | Build habits around tests, benchmarks, vet, race detection, modularity, API design, and Web engineering. | DesignPatterns/, webdemo/, OSExam/ |
You can extend modules using a maintainable engineering standard. |
See the full route in docs/roadmaps/beginner-to-expert.md.
The core modules now read like textbook chapters. Each chapter includes goals, prerequisites, a mental model, invariants, operation walkthroughs, complexity derivations, common mistakes, worked examples, exercises, hints, reference answers, and test commands.
| Spine area | Start here | Continue with |
|---|---|---|
| Go fundamentals | BasicGo | Pointers, structs, interfaces, errors, tests, concurrency |
| Linear structures | Linked | DoubleLinked, stack, queue, Circular queue |
| Priority and connectivity | Heap | Union |
| Trees and search structures | BinarySearch | AVL, Red-Black, Segment, Trie, skiplists |
| Sorting | Sorts | Benchmarks and stability analysis |
| Graphs | Graph_algo | Adjacency, BFS, DFS, Search, Applied problems |
Maintainers should follow the Textbook Style Guide when adding or expanding chapters.
| Entrypoint | Purpose |
|---|---|
| Textbook Style Guide | Defines the module chapter structure, exercise format, diagrams, complexity notation, and linking rules. |
| Knowledge Graph | Shows prerequisite, practice, and deepening relationships. |
| Structured Knowledge Data | Stable data for future generated pages or visualizations. |
| DIRECTORY.md | TheAlgorithms-style topic directory for the whole repository. |
| Learning Catalog | Difficulty, prerequisites, next topics, and practice tasks. |
| Go Programming Language Gap Map | Maps book chapters to repository stages and modules. |
| Exercise Matrix | Reading, rewrite, test, implementation, benchmark, and refactor tasks. |
| Expert Track | A path from writing Go code to maintaining Go systems. |
| Contributing Guide | Rules for new topics, tests, docs, and knowledge graph updates. |
| Path | Learning content |
|---|---|
BasicGo/ |
Go basics, pointers, concurrency, context, reflection, generics, and low-level layout. |
Linked/, DoubleLinked/ |
Singly linked lists, doubly linked lists, LRU, LFU, and FIFO caches. |
stack/, queue/, main/622.go |
Stack, queue, and circular queue. |
BinarySearch/, AVL/, Red-Black/, Segment/ |
Search trees, balanced trees, and segment trees. |
Trie/, skiplists/, Union/, Heap/, Set/ |
Prefix trees, skip lists, union-find, heaps, and sets. |
Sorts/ |
Bubble, insertion, selection, merge, quick, shell, bucket, and counting sorts. |
Graph_algo/ |
Graph representations, BFS, DFS, paths, cycle detection, bipartite checks, and graph exercises. |
DesignPatterns/ |
Creational, structural, behavioral, and compound design patterns. |
OSExam/ |
FCFS, SJF, priority scheduling, and a file-system skeleton. |
webdemo/ |
Native HTTP, Gin, mini-Gin, and a red-packet demo. |
- Find your current position in the Knowledge Graph.
- Pick a stage in Beginner to Expert.
- Read the local README and source code for the module.
- Run the module tests, for example
go test ./Graph_algo/search. - Complete a task from the Exercise Matrix.
- Finish with
go vet ./...andgo test ./....
Every change should keep these commands green:
go vet ./...
go test ./...New topics should include:
- A topic README or equivalent documentation.
- Table-driven tests.
- Complexity and core invariant notes.
- Entries in
DIRECTORY.md,docs/catalog.md, anddocs/data/knowledge-graph.json.
See ROADMAP.md. Current priorities include generated directory indexes, more benchmarks, go test -race examples, Dependabot vulnerability cleanup, and a stronger expert learning track.
MIT. See LICENSE.