stack-go
Go (Golang) programming language — idiomatic structures, concurrency, error handling, and testing (table-driven, golden files, Bubbletea)
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- stack-go
- license
- Apache-2.0
- metadata
- { "author": "manuel-retamozo-garcia", "version": "1.0" }
- description
- Go (Golang) programming language — idiomatic structures, concurrency, error handling, and testing (table-driven, golden files, Bubbletea)
- capabilities
- [ "go" ]
02 资源文件 3
- 参考文档references/patterns.md13.4 KB
- 参考文档references/testing-examples.md2.0 KB
- 参考文档references/testing.md1.9 KB
03 SKILL.md 正文
Go Development Patterns
Idiomatic Go patterns and best practices for building robust, efficient, and maintainable applications.
When to Activate
- Writing new Go code
- Reviewing Go code
- Refactoring existing Go code
- Designing Go packages/modules
- Writing or reviewing Go tests, golden files, or Bubbletea/TUI flows
Core Rules
- Simplicity and Clarity: Favor simple, clear, and predictable Go code. Handle errors immediately and return early. Keep the happy path unindented.
- Make Zero Value Useful: Design types (especially with mutexes or buffers) so they are usable without explicit initialization.
- Accept Interfaces, Return Structs: Keep interfaces small and define them where they are consumer-needed rather than provider-delivered.
- Error Handling: Wrap errors with context (
fmt.Errorf("...: %w", err)). Never swallow or ignore errors silently. - Concurrency Safety: Coordinate goroutines via errgroups or context. Avoid goroutine leaks by listening to
ctx.Done(). - Testing (
references/testing.md): Table-driven cases witht.Run,t.TempDir()for files, integration tests skippable withtesting.Short(); update golden files only via-update, then rerun without it.
References
Load on demand, only the file the task needs:
- Go Coding Patterns & Examples
- Go Testing — decision gate per test type, Bubbletea and
teatest, golden files; examples in testing-examples.md
04 同仓库更多 Skills
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.
stack-webmcp
Trigger: WebMCP, document.modelContext, web tools, AI browser agent. Web Model Context Protocol client-side tool standard.
stack-vite
Vite frontend build tool — configuration, plugins, asset loading
stack-starlight
Astro Starlight documentation framework — setup, sidebar navigation, frontmatter, built-in components, asides, theming, i18n, search
stack-sqlserver
Microsoft SQL Server database — indexing, RCSI, set-based operations, SARGable queries, transaction scopes
stack-springboot
Spring Boot architecture patterns — REST API design, layered services, JPA, caching, Spring Security, TDD with MockMvc and Testcontainers, and pre-release verification