Loading...
Loading...
Shared Go best practices for LlamaFarm CLI. Covers idiomatic patterns, error handling, and testing.
npx skill4agent add llama-farm/llamafarm go-skillscli/
cmd/ # Command implementations
config/ # Configuration types and loading
orchestrator/ # Service management
utils/ # Shared utilities
version/ # Version and upgrade handling
internal/ # Internal packages
tui/ # TUI components
buildinfo/ # Build informationfmt.Errorf("operation failed: %w", err)var ErrNotFound = errors.New("not found")sync.Mutexsync.RWMutexdefer*_test.gocontext.Context| File | Description |
|---|---|
| patterns.md | Idiomatic Go patterns |
| concurrency.md | Goroutines, channels, sync |
| error-handling.md | Error wrapping, sentinels |
| testing.md | Table-driven tests, mocks |
| security.md | Input validation, secure coding |
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}type ProcessManager struct {
mu sync.RWMutex
processes map[string]*ProcessInfo
}var myCmd = &cobra.Command{
Use: "mycommand",
Short: "Brief description",
RunE: func(cmd *cobra.Command, args []string) error {
// Implementation
return nil
},
}type myModel struct {
// State fields
}
func (m myModel) Init() tea.Cmd { return nil }
func (m myModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { /* ... */ }
func (m myModel) View() string { return "" }