mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-14 13:53:29 +08:00
Add Kiro IDE support (.kiro/) (#548)
Co-authored-by: Sungmin Hong <hsungmin@amazon.com>
This commit is contained in:
45
.kiro/steering/golang-patterns.md
Normal file
45
.kiro/steering/golang-patterns.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
inclusion: fileMatch
|
||||
fileMatchPattern: "*.go"
|
||||
description: Go-specific patterns including functional options, small interfaces, and dependency injection
|
||||
---
|
||||
|
||||
# Go Patterns
|
||||
|
||||
> This file extends the common patterns 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.
|
||||
Reference in New Issue
Block a user