MCPcopy Index your code
hub / github.com/cuongtk8/7_days_of_go

github.com/cuongtk8/7_days_of_go @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
424 symbols 779 edges 57 files 37 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

banner

the artwork created by Wonkeen.

🗺 Roadmap

roadmap

PDF file


📅 Day-by-Day Overview

Day 1 — Go Basics

Topic Description
Hello World fmt.Printf basics
Functions Regular, multiple return values, named returns
Variables & Constants var, shorthand :=, const, global vs local
Basic Types bool, string, int, float, byte, rune, numeric limits
Type Conversion Explicit casting between numeric types
Loops for (classic, while-style, infinite)
Conditionals & Switch if/else with short statements, switch with and without a condition
Defer LIFO execution order, argument evaluation at call time
Pointers Address-of &, dereference *, nil pointer
Structs Declaration, pointer receivers, field initialisation
Arrays Fixed-length, iteration with range
Slices Dynamic views over arrays, make, append, length vs capacity
Maps make, literals, insert/update/delete, key-existence check
Function Closures Functions capturing outer variables
Methods Value and pointer receivers
Interfaces Implicit satisfaction, interface variable
Goroutines go keyword, channels, synchronisation with WaitGroup

Day 1 README

Day 2 — Concurrency

Topic Description
Goroutines Launching goroutines, sending/receiving on channels
Buffered channels Capacity limit, blocking behaviour
Closing channels close(), two-value receive, range over channels
WaitGroup Add, Done, Wait for goroutine synchronisation
CLI flags flag package — declaring, parsing, and using command-line flags

Day 2 README

Day 3 — Error Handling, JSON & Struct Tags

Topic Description
Error handling Four patterns: basic error, pkg/errors (wrap/stack/message), xerrors, and fmt.Errorf with %w
JSON Encoding (json.Marshal, json.MarshalIndent), decoding (json.Unmarshal), and validation (json.Valid)
Struct tags Controlling JSON output with json:"name", json:"-" (exclude), and omitempty
UID Generating short unique IDs with github.com/103cuong/uid

Day 3 README

Day 4 — HTTP Server & REST API

Topic Description
Simple HTTP server Routes and handlers using Go's built-in net/http package
Fiber + GORM REST API Full CRUD API (/api/cats) using the Fiber web framework and GORM ORM with a SQLite database

Day 4 README

Day 5 — Go Project Template & Load Balancer

Topic Description
go_template Lightweight starter template with linting, Docker, CI, and Go Modules
simple_load_balancer Round-Robin HTTP load balancer with health checking using httputil.ReverseProxy and atomic operations

Day 5 README

Day 6 — GraphQL & Pub/Sub

Topic Description
simple_graphql_go Minimal GraphQL server with graph-gophers/graphql-go
graphql Schema-first GraphQL server generated by gqlgen, connected to MySQL
pubsub_go In-memory Publish/Subscribe system built with Go channels and sync.RWMutex

Day 6 README

Day 7 — gRPC

Topic Description
hello_world Minimal gRPC server and client implementing a SayHello unary RPC
go_grpc Full CRUD gRPC microservice (To-Do) with MySQL, HTTP/REST gateway, and BloomRPC support

Day 7 README


📝 Documents

🦄 License

MIT © Cuong Nguyen

Extension points exported contracts — how you extend this code

Cat (Interface)
(no doc) [1 implementers]
day 1/16_interfaces.go

Core symbols most depended-on inside this repo

Close
called by 11
day 6/pubsub_go/main.go
checkAPIVersion
called by 5
day 7/go_grpc/pkg/service/v1/todo-service.go
connect
called by 5
day 7/go_grpc/pkg/service/v1/todo-service.go
sayHi
called by 3
day 2/goroutines.go
greet
called by 2
day 2/wait_group.go
Uid
called by 2
day 3/uid/uid.go
sum
called by 2
day 1/17_goroutines.go
greet
called by 1
day 2/closing_channels.go

Shape

Method 267
Function 103
Struct 46
Interface 8

Languages

Go100%

Modules by API surface

day 6/graphql/graph/generated/generated.go133 symbols
day 7/go_grpc/pkg/api/v1/todo-service.pb.go124 symbols
day 7/hello_world/api/greeter.pb.go29 symbols
day 5/simple_load_balancer/main.go12 symbols
day 7/go_grpc/pkg/service/v1/todo-service.go9 symbols
day 6/graphql/graph/schema.resolvers.go9 symbols
day 6/pubsub_go/main.go6 symbols
day 6/graphql/graph/model/models_gen.go6 symbols
day 4/fiber_gorm_rest_api/cat/cat.go6 symbols
day 1/7_conditional_statement.go5 symbols
day 1/2_function.go5 symbols
day 1/17_goroutines.go5 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add 7_days_of_go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact