ข้ามไปยังเนื้อหา

Go Deep Dive

คอร์สนี้สอน Go ในเชิงลึก — บนพื้นฐานของภาษา Go เอง ไม่ใช่การเปรียบเทียบกับภาษาอื่น คุณจะเรียนรู้โมเดล concurrency แบบ CSP, type system ที่เข้มแข็ง, และ toolchain ที่ครบครัน ซึ่งทำให้ Go เป็นภาษาที่เลือกใช้สำหรับระบบ production ที่ต้องการประสิทธิภาพสูง

เรียนเป็นลำดับตามโมดูล แต่ละบทเรียนมี snippet ที่รันได้ใน browser, quiz ตรวจสอบความเข้าใจ, และปุ่มทำเครื่องหมายเสร็จสิ้น เริ่มจาก Basics & Syntax แล้วไล่ขึ้นไปจนถึง Concurrency และ Testing & Tooling

โมดูลหัวข้อสถานะ
Basics & SyntaxVariables, types, control flow, functions, packagesพร้อมใช้งานแล้ว
Types & DataArrays, slices, maps, structs, pointersพร้อมใช้งานแล้ว
Methods & InterfacesMethods บน types, interface design, composition, embeddingพร้อมใช้งานแล้ว
ConcurrencyGoroutines, channels, select, sync, context, patternsพร้อมใช้งานแล้ว
Errors & GenericsError wrapping, custom errors, generics กับ type parametersพร้อมใช้งานแล้ว
Standard Libraryfmt, strings, io, net/http, encoding/json, timeพร้อมใช้งานแล้ว
Testing & Toolinggo test, table-driven tests, benchmarks, race detector, go vetพร้อมใช้งานแล้ว

เริ่มต้นกับ Basics & Syntax หากคุณใหม่กับ Go หรือข้ามไปที่ Concurrency — โมดูลที่ทำให้ Go โดดเด่น

สิ่งที่ได้ประโยชน์ต้นทุน
goroutinelightweight concurrency (2-8 KB stack)scheduler overhead
GCไม่ต้อง manage memory เองGC pause latency
static binarydeploy ง่าย ไม่มี dependencybinary size ใหญ่กว่า interpreted lang
interfaceimplicit satisfaction, decoupled designdynamic dispatch cost
no generics (pre-1.18)simplicitycode duplication

💡 ตัวอย่างจากของจริง

Kubernetes เขียนด้วย Go ทั้งหมด — goroutine หลักแสนตัวจัดการ pod lifecycle พร้อมกัน

Docker ใช้ Go สำหรับ container runtime — memory-efficient และ deploy เป็น single binary

Prometheus ใช้ Go สำหรับ time-series collection — goroutine pool รับ metrics จาก target นับพัน

etcd ใช้ Go สำหรับ distributed key-value store — channel และ mutex ทำให้ consensus algorithm ปลอดภัย