diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-16 03:55:40 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-16 03:55:40 +0200 |
| commit | 35f1097f473e51be82f68e93ea2db48dd1c98519 (patch) | |
| tree | 1b0a316caa9bbbbfab20b6665b424f356f411ac2 /internal/appconfig | |
| parent | 93dfe3798e03e74766b229418cde364a5ef29ae9 (diff) | |
Fix mixed pointer/value receivers on appconfig.App
Change all value receivers on App to pointer receivers for consistency.
Update callers that pass App values to pass pointers where needed for
the actionConfig interface.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/appconfig')
| -rw-r--r-- | internal/appconfig/app_sections.go | 10 | ||||
| -rw-r--r-- | internal/appconfig/config_validate.go | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/appconfig/app_sections.go b/internal/appconfig/app_sections.go index 7422152..430ebce 100644 --- a/internal/appconfig/app_sections.go +++ b/internal/appconfig/app_sections.go @@ -127,7 +127,7 @@ type AppSections struct { } // Sections returns the app configuration split into focused sub-configs. -func (a App) Sections() AppSections { +func (a *App) Sections() AppSections { return AppSections{ Core: a.CoreSection(), Providers: a.ProviderSection(), @@ -146,7 +146,7 @@ func (a *App) ApplySections(sections AppSections) { // CoreSection returns a deep copy of the core runtime and interaction settings. // Slices are cloned to prevent callers from mutating the original. -func (a App) CoreSection() CoreConfig { +func (a *App) CoreSection() CoreConfig { c := a.CoreConfig c.TriggerCharacters = slices.Clone(a.TriggerCharacters) c.ChatPrefixes = slices.Clone(a.ChatPrefixes) @@ -163,7 +163,7 @@ func (a *App) ApplyCoreSection(core CoreConfig) { // ProviderSection returns a deep copy of provider endpoint/model settings. // Surface config slices are cloned to prevent callers from mutating the original. -func (a App) ProviderSection() ProviderConfig { +func (a *App) ProviderSection() ProviderConfig { p := a.ProviderConfig p.CompletionConfigs = cloneSurfaceConfigs(a.CompletionConfigs) p.CodeActionConfigs = cloneSurfaceConfigs(a.CodeActionConfigs) @@ -184,7 +184,7 @@ func (a *App) ApplyProviderSection(providers ProviderConfig) { // PromptSection returns a deep copy of prompt templates and custom action settings. // The CustomActions slice is cloned to prevent callers from mutating the original. -func (a App) PromptSection() PromptConfig { +func (a *App) PromptSection() PromptConfig { p := a.PromptConfig p.CustomActions = append([]CustomAction{}, a.CustomActions...) return p @@ -199,7 +199,7 @@ func (a *App) ApplyPromptSection(prompts PromptConfig) { // FeatureSection returns a deep copy of non-LLM feature toggles and integrations. // Slices are cloned to prevent callers from mutating the original. -func (a App) FeatureSection() FeatureConfig { +func (a *App) FeatureSection() FeatureConfig { f := a.FeatureConfig f.IgnoreExtraPatterns = slices.Clone(a.IgnoreExtraPatterns) f.TmuxEditAgents = append([]TmuxEditAgentCfg{}, a.TmuxEditAgents...) diff --git a/internal/appconfig/config_validate.go b/internal/appconfig/config_validate.go index f5e698f..19cfcd0 100644 --- a/internal/appconfig/config_validate.go +++ b/internal/appconfig/config_validate.go @@ -6,7 +6,7 @@ import ( ) // Validate checks custom actions and tmux settings for duplicates and consistency. -func (a App) Validate() error { +func (a *App) Validate() error { if err := validateCustomActions(a.CustomActions); err != nil { return err } |
