skills/caijiatao/skills/effective-go

effective-go

Originally fromopenshift/hypershift
SKILL.md

Effective Go

Apply best practices and conventions from the official Effective Go guide to write clean, idiomatic Go code.

When to Apply

Use this skill automatically when:

  • Writing new Go code
  • Reviewing Go code
  • Refactoring existing Go implementations

Core Concepts

Topic Description Reference
Formatting Always use gofmt - this is non-negotiable core-formatting
Naming MixedCaps for exported, mixedCaps for unexported core-naming
Error Handling Check errors, return them, don't panic core-error-handling
Concurrency Share memory by communicating (use channels) core-concurrency
Interfaces Keep small (1-3 methods ideal); accept interfaces, return concrete types core-interfaces
Documentation Document all exported symbols core-documentation

Key Reminders

Follow the conventions and patterns documented at https://go.dev/doc/effective_go:

  • Formatting: Use gofmt - this is non-negotiable
  • Naming: No underscores, use MixedCaps for exported names
  • Error handling: Always check errors; return them, don't panic
  • Concurrency: Share memory by communicating
  • Interfaces: Keep small and accept interfaces, return structs
  • Documentation: Document all exported symbols

References

Weekly Installs
4
GitHub Stars
1
First Seen
Feb 25, 2026
Installed on
opencode4
gemini-cli4
amp4
github-copilot4
codex4
kimi-cli4