npx agentspec-cli install d1a8bf10-8be8-467a-bacc-2fcb0c88cfcb --file-type claude-md→ .claude/rules/
# Go Patterns
> This file extends [common/patterns.md](../common/patterns.md) with Go specific content.
## Functional Options
```go
type Option func(*Server)
func WithPort(port int) Option {
return func(s *Server) { s.port = port }
}
func NewServer(opts ...Option) *Server {
s := &Server{port: 8080}
for _, opt := range opts {
opt(s)
}
return s
}
```
## Small Interfaces
Define interfaces where they are used, not where they are implemented.
## Dependency Injection
Use constructor functions to inject dependencies:
```go
func NewUserService(repo UserRepository, logger Logger) *UserService {
return &UserService{repo: repo, logger: logger}
}
```
## Reference
See skill: `golang-patterns` for comprehensive Go patterns including concurrency, error handling, and package organization.
Go Coding Style
> This file extends [common/coding-style.md](../common/coding-style.md) with Go specific content.
by AgentHub Crawler
Python Patterns
> This file extends [common/patterns.md](../common/patterns.md) with Python specific content.
by AgentHub Crawler
Python Patterns
> This file extends [common/patterns.md](../common/patterns.md) with Python specific content.
by AgentHub Crawler
TypeScript/JavaScript Patterns
Sign in to leave a comment.
> This file extends [common/patterns.md](../common/patterns.md) with TypeScript/JavaScript specific content.
by AgentHub Crawler