This repository is a self-contained Go course. It is split into two parts:
part1-language/— 13 markdown chapters covering the Go language with runnable examples inpart1-language/examples/.part2-dsa/— 8 markdown chapters on data structures and algorithms (array, stack, queue, sort, hash, heap, balanced BST, graph), each with a Go package underpart2-dsa/ds/and unit tests.
Everything lives in one Go module (module golearn) so you can run:
go vet ./...
go test ./...
from the repository root.
Layout
.
├── go.mod
├── README.md
├── part1-language/
│ ├── 01-why-go.md
│ ├── 02-environment-and-tooling.md
│ ├── 03-lexical-basics.md
│ ├── 04-built-in-types.md
│ ├── 05-control-flow.md
│ ├── 06-functions-and-methods.md
│ ├── 07-interfaces.md
│ ├── 08-pointers-and-memory.md
│ ├── 09-generics.md
│ ├── 10-concurrency.md
│ ├── 11-testing.md
│ ├── 12-modules.md
│ ├── 13-practical-go.md
│ └── examples/
│ ├── 03_lexical/main.go
│ ├── 04_types/main.go
│ ├── 05_control/main.go
│ ├── 06_funcs/main.go
│ ├── 07_interfaces/main.go
│ ├── 08_pointers/main.go
│ ├── 09_generics/main.go
│ ├── 10_concurrency/main.go
│ ├── 11_testing/strings.go
│ ├── 11_testing/strings_test.go
│ └── 13_practical/main.go
└── part2-dsa/
├── 01-array.md
├── 02-stack.md
├── 03-queue.md
├── 04-sort.md
├── 05-hash.md
├── 06-heap.md
├── 07-avl.md
├── 08-graph.md
└── ds/
├── arrayx/ array.go + array_test.go
├── stack/ stack.go + stack_test.go
├── queue/ queue.go + queue_test.go
├── sortx/ sorts.go + sorts_test.go
├── hashmap/ hashmap.go + hashmap_test.go
├── heapx/ minheap.go + minheap_test.go
├── avl/ avl.go + avl_test.go
└── graph/ graph.go, dijkstra.go + graph_test.go
How to study
- Read
part1-language/01-why-go.mdand proceed in numerical order. - For each chapter, read the markdown then run the matching example:
bash go run ./part1-language/examples/03_lexical - For Part 2, read each chapter and run the tests for that package:
bash go test ./part2-dsa/ds/heapx/... - Modify the code and re-run; the tests are written so failures are easy to read.
Everything uses only the Go standard library.