go-best-practices
/go-best-practices
Podpowiada wzorce produkcyjne w Go: cykl życia, współbieżność, konfigurację, testy i CI przy pisaniu i przeglądzie kodu.
- Autor
- guangshinhaha ↗
- Repozytorium
- shinstack ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 13.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 3
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Podpowiada wzorce produkcyjne w Go: cykl życia, współbieżność, konfigurację, testy i CI przy pisaniu i przeglądzie kodu.
Wyzwalacze z opisu
Oryginalny opis (EN)
Production Go patterns — lifecycle, concurrency, config, testing, CI. Use when writing, reviewing, or refactoring Go code. Triggers on Go code review, Go refactoring, or 'go best practices'.
Jak działa
- Rules
Podgląd SKILL.md
---
name: go-best-practices
description: >
Production Go patterns — lifecycle, concurrency, config, testing, CI. Use when
writing, reviewing, or refactoring Go code. Triggers on Go code review, Go refactoring,
or 'go best practices'.
---
# Go Best Practices
| Pattern | When to apply |
|---------|---------------|
| Minimal main | New binaries |
| Single bootstrap | App wiring across modes |
| Ordered shutdown | Long-running processes |
| Non-blocking fanout | Channel-based event systems |
| Concurrency testing | Any goroutine code |
| Layered config | Multi-source configuration |
| Cross-platform paths | File/config path resolution |
| Secure debug logging | HTTP client instrumentation |
| Golden test matrices | Rendering / output components |
| Focused linters | CI pipeline setup |
Read [references/patterns.md](references/patterns.md) for code examples.
## Rules
1. **main.go is a stub.** Call `cmd.Execute()` and nothing else. Gate
diagnostics (pprof) behind env vars.
2. **One bootstrap path.** All modes (interactive, headless, test) share the
same initialization function. Two paths will drift.
3. **Ordered shutdown.** Cancel dependents before their dependencies, then run
independent cleanup in parallel under a timeout context. WaitGroup the
parallel phase.
4. **Never block the sender.** Non-blocking channel sends with an explicit
drop policy. Log drops at debug level. Document the policy.
5. **Test concurrency mechanically.** `testing/synctest` for deterministic
timing, `goleak.VerifyNone` for leak detection, dedicated regression tests
for timer/channel deadlocks.
6. **Explicit config precedence.** Global → project → flags. Walk up from CWD
to discover project configs, reverse so closest wins, deep-merge.
7. **Centralize platform paths.** One function per concern. Resolution order:
env override → XDG → platform default → fallback.
8. **Redact secrets in debug logs.** Wrap `http.RoundTripper`. Filter headers
matching authorization, api-key, token, secret. Gate on debug level to
skip allocation in prod.
9. **Golden tests over matrices.** Cross dimensions (layout × theme × size)
as parallel subtests. Sweep continuous ranges to catch off-by-one bugs.
10. **Focused linters, not all linters.** Enable what catches real bugs
(bodyclose, noctx, tparallel). Disable noisy defaults. Add project-specific
checks as scripts. Always `-race` in tests.
Pliki w paczce (3)
- LICENSE.txt 1 KB
- SKILL.md 2 KB
- references/patterns.md 9 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · guangshinhaha/shinstack | 100 | MIT |
| alleneubank/claude-code | 91 | Apache-2.0 |
Migawka bazy z 13.11.2026 · wersja paczki 4c52ff85161e (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100nestjs-best-practices
Wskazuje dobre praktyki i wzorce architektury NestJS przy pisaniu, przeglądzie i refaktoryzacji: moduły, wstrzykiwanie zależności, bezpieczeństwo i wydajność. - 95vercel-react-best-practices
Podpowiada wzorce wydajności przy pisaniu, przeglądzie i refaktoryzacji komponentów React oraz stron Next.js. - 100vercel-react-best-practices
Podpowiada wzorce wydajności React i Next.js przy pisaniu i przeglądzie komponentów, stron oraz pobierania danych. - 100react-best-practices
Podpowiada, jak optymalizować wydajność React i Next.js przy pisaniu, przeglądzie i refaktoryzacji kodu z pobieraniem danych i paczkami. - 95react-best-practices
Podaje wytyczne wydajności React i Next.js z Vercel Engineering przy pisaniu, przeglądzie lub refaktoryzacji kodu. - 100rust-patterns
Podaje idiomatyczne wzorce Rust: własność, obsługę błędów, cechy, współbieżność i dobre praktyki przy pisaniu lub przeglądzie kodu.