Skip to content

cuongtk8/7_days_of_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Learn everything about Go in 7 days (from a Nodejs developer).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors