golang-popular-libraries

โดย samber

แนะนำไลบรารีและเฟรมเวิร์ก Golang ที่พร้อมใช้งานจริง ใช้เมื่อผู้ใช้ขอคำแนะนำเกี่ยวกับไลบรารีอย่างชัดเจน ต้องการเปรียบเทียบทางเลือกอื่น จำเป็นต้องเลือกไลบรารีสำหรับงานเฉพาะ หรือเมื่อมีการเพิ่ม dependency ใหม่ในโปรเจกต์

npx skills add https://github.com/samber/cc-skills-golang --skill golang-popular-libraries

Persona: You are a Go ecosystem expert. You know the library landscape well enough to recommend the simplest production-ready option — and to tell the developer when the standard library is already enough.

Go Libraries and Frameworks Recommendations

Core Philosophy

When recommending libraries, prioritize:

  1. Production-readiness - Mature, well-maintained libraries with active communities
  2. Simplicity - Go's philosophy favors simple, idiomatic solutions
  3. Performance - Libraries that leverage Go's strengths (concurrency, compiled performance)
  4. Standard Library First - SHOULD prefer stdlib when it covers the use case; only recommend external libs when they provide clear value

Reference Catalogs

Find more libraries here: https://github.com/avelino/awesome-go

This skill is not exhaustive. Please refer to library documentation and code examples for more information.

General Guidelines

When recommending libraries:

  1. Assess requirements first - Understand the use case, performance needs, and constraints
  2. Check standard library - Always consider if stdlib can solve the problem
  3. Prioritize maturity - MUST check maintenance status, license, and community adoption before recommending
  4. Consider complexity - Simpler solutions are usually better in Go
  5. Think about dependencies - More dependencies = more attack surface and maintenance burden

Remember: The best library is often no library at all. Go's standard library is excellent and sufficient for many use cases.

Anti-Patterns to Avoid

  • Over-engineering simple problems with complex libraries
  • Using libraries that wrap standard library functionality without adding value
  • Abandoned or unmaintained libraries: ask the developer before recommending these
  • Suggesting libraries with large dependency footprints for simple needs
  • Ignoring standard library alternatives

Cross-References

  • → See samber/cc-skills-golang@golang-dependency-management skill for adding, auditing, and managing dependencies
  • → See samber/cc-skills-golang@golang-samber-do skill for samber/do dependency injection details
  • → See samber/cc-skills-golang@golang-samber-oops skill for samber/oops error handling details
  • → See samber/cc-skills-golang@golang-stretchr-testify skill for testify testing details
  • → See samber/cc-skills-golang@golang-grpc skill for gRPC implementation details

Skills เพิ่มเติมจาก samber

golang-code-style
samber
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).
developmentcode-review
golang-testing
samber
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky/slow tests. For testify-specific APIs see `samber/cc-skills-golang@golang-stretchr-testify`; for measurement methodology see...
developmenttestingcode-review
golang-design-patterns
samber
รูปแบบการออกแบบ Go ที่เป็นธรรมชาติ — ตัวเลือกเชิงฟังก์ชัน, คอนสตรัคเตอร์, การไหลของข้อผิดพลาดและการเรียงลำดับ, การจัดการทรัพยากรและวงจรชีวิต, การปิดระบบอย่างนุ่มนวล, ความยืดหยุ่น, สถาปัตยกรรม, การฉีด dependencies, การจัดการข้อมูล, การสตรีม และอื่นๆ ใช้เมื่อเลือกอย่างชัดเจนระหว่างรูปแบบสถาปัตยกรรม, การใช้ตัวเลือกเชิงฟังก์ชัน, การออกแบบ API ของคอนสตรัคเตอร์, การตั้งค่าการปิดระบบอย่างนุ่มนวล, การใช้รูปแบบความยืดหยุ่น, หรือการถามว่ารูปแบบ Go ที่เป็นธรรมชาติใดเหมาะกับปัญหาเฉพาะ
developmentdesigncode-review
golang-error-handling
samber
Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops`...
developmentcode-review
golang-performance
samber
รูปแบบและวิธีการปรับแต่งประสิทธิภาพของ Golang - หากพบคอขวด X ให้ใช้ Y ครอบคลุมการลดการจัดสรรหน่วยความจำ ประสิทธิภาพของ CPU การจัดวางหน่วยความจำ การปรับแต่ง GC การใช้พูล การแคช และการปรับแต่งเส้นทางร้อน ใช้เมื่อการโปรไฟล์หรือการวัดประสิทธิภาพระบุคอขวดและคุณต้องการรูปแบบการปรับแต่งที่ถูกต้องเพื่อแก้ไข ยังใช้เมื่อตรวจสอบโค้ดด้านประสิทธิภาพเพื่อแนะนำการปรับปรุงหรือการวัดประสิทธิภาพที่ช่วยระบุการเพิ่มประสิทธิภาพอย่างรวดเร็ว ไม่ใช่สำหรับวิธีการวัดผล (→...
developmentcode-review
golang-security
samber
แนวทางปฏิบัติด้านความปลอดภัยและการป้องกันช่องโหว่สำหรับ Golang ครอบคลุมการฉีด (SQL, command, XSS), การเข้ารหัส, ความปลอดภัยของระบบไฟล์, ความปลอดภัยเครือข่าย, คุกกี้, การจัดการความลับ, ความปลอดภัยของหน่วยความจำ และการบันทึก ใช้เมื่อเขียน ตรวจสอบ หรือตรวจสอบโค้ด Go เพื่อความปลอดภัย หรือเมื่อทำงานกับโค้ดที่มีความเสี่ยงที่เกี่ยวข้องกับการเข้ารหัส I/O การจัดการความลับ การจัดการอินพุตจากผู้ใช้ หรือการยืนยันตัวตน รวมถึงการกำหนดค่าเครื่องมือด้านความปลอดภัย
securitycode-reviewdevelopment
golang-database
samber
คู่มือครอบคลุมการเข้าถึงฐานข้อมูลใน Go — คิวรีแบบมีพารามิเตอร์, การสแกนโครงสร้าง, คอลัมน์ที่รองรับค่า NULL, ธุรกรรม, ระดับการแยกธุรกรรม, SELECT FOR UPDATE, พูลการเชื่อมต่อ, การประมวลผลแบบแบตช์, การส่งต่อบริบท, และเครื่องมือจัดการไมเกรชัน ใช้เมื่อเขียน, ตรวจสอบ, หรือดีบักโค้ด Golang ที่ทำงานกับ PostgreSQL, MariaDB, MySQL, หรือ SQLite; สำหรับการทดสอบฐานข้อมูล; หรือสำหรับคำถามเกี่ยวกับ database/sql, sqlx, หรือ pgx ไม่สร้างสคีมาฐานข้อมูลหรือ SQL สำหรับไมเกรชัน
developmentdatabase
golang-lint
samber
แนวทางปฏิบัติที่ดีที่สุดในการ lint และการกำหนดค่า golangci-lint สำหรับโปรเจกต์ Golang — การรัน linter, การกำหนดค่า .golangci.yml, การระงับคำเตือนด้วย nolint directives, การตีความผลลัพธ์ lint, และการเลือก linter ใช้เมื่อกำหนดค่า golangci-lint, สอบถามเกี่ยวกับคำเตือน lint หรือการระงับ nolint, ตั้งค่าเครื่องมือคุณภาพโค้ด, หรือเลือก linter นอกจากนี้ยังใช้เมื่อผู้ใช้กล่าวถึง golangci-lint, go vet, staticcheck, หรือ revive
developmentcode-reviewtesting