summaryrefslogtreecommitdiff
path: root/internal/appconfig
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-17 23:06:37 +0300
committerPaul Buetow <paul@buetow.org>2025-08-17 23:06:37 +0300
commit041d1f140436c6fdd223844b04c6592c84951878 (patch)
treee44df5d5691408216a26d472f7e96278095319d2 /internal/appconfig
parentd72f95ae4e6cd4e7a0beca2b9764511c10de8655 (diff)
refactor(ordering): place constructors immediately after type definitions as first functions
Diffstat (limited to 'internal/appconfig')
-rw-r--r--internal/appconfig/config.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/internal/appconfig/config.go b/internal/appconfig/config.go
index 1f7e9d8..7027547 100644
--- a/internal/appconfig/config.go
+++ b/internal/appconfig/config.go
@@ -31,6 +31,17 @@ type App struct {
CopilotModel string `json:"copilot_model"`
}
+// Constructor: defaults for App (kept first among functions)
+func newDefaultConfig() App {
+ return App{
+ MaxTokens: 4000,
+ ContextMode: "always-full",
+ ContextWindowLines: 120,
+ MaxContextTokens: 4000,
+ LogPreviewLimit: 100,
+ }
+}
+
// Load reads configuration from a file and merges with defaults.
// It respects the XDG Base Directory Specification.
func Load(logger *log.Logger) App {
@@ -55,16 +66,6 @@ func Load(logger *log.Logger) App {
}
// Private helpers
-func newDefaultConfig() App {
- return App{
- MaxTokens: 4000,
- ContextMode: "always-full",
- ContextWindowLines: 120,
- MaxContextTokens: 4000,
- LogPreviewLimit: 100,
- }
-}
-
func loadFromFile(path string, logger *log.Logger) (*App, error) {
f, err := os.Open(path)
if err != nil {