go-best-practices
Go Best Practices
Type-First Development
Types define the contract before implementation. Follow this workflow:
- Define data structures - structs and interfaces first
- Define function signatures - parameters, return types, and error conditions
- Implement to satisfy types - let the compiler guide completeness
- Validate at boundaries - check inputs where data enters the system
Make Illegal States Unrepresentable
Use Go's type system to prevent invalid states at compile time.
Structs for domain models:
// Define the data model first
type User struct {
More from neversight/skills_feed
ai-image-generation
|
7react-best-practices
Provides React patterns for hooks, effects, refs, and component design. Covers escape hatches, anti-patterns, and correct effect usage. Must use when reading or writing React components (.tsx, .jsx files with React imports).
7ui-designer
Use when user needs visual UI design, interface creation, component systems, design systems, interaction patterns, or accessibility-focused user interfaces.
7python-env
Fast Python environment management with uv (10-100x faster than pip). Triggers on: uv, venv, pip, pyproject, python environment, install package, dependencies.
7typescript-best-practices
Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation. Must use when reading or writing TypeScript/JavaScript files.
6ai-marketing-videos
|
6