Skip to content

Commit

Permalink
fix: address typo in completeGlobalOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Aug 1, 2024
1 parent 76b6501 commit 840b143
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ func (g GlobalOptions) toEnv() []string {
}

func completeGlobalOptions(opts ...GlobalOptions) GlobalOptions {
result := GlobalOptions{}
var result GlobalOptions
for _, opt := range opts {
result.OpenAIAPIKey = firstSet(opt.OpenAIAPIKey, result.OpenAIAPIKey)
result.OpenAIBaseURL = firstSet(opt.OpenAIBaseURL, result.OpenAIBaseURL)
result.DefaultModel = firstSet(opt.DefaultModel, result.DefaultModel)
result.DefaultModelProvider = firstSet(opt.DefaultModelProvider, result.DefaultModelProvider)
result.Env = append(result.Env, opt.Env...)
}
return opts[0]
return result
}

func firstSet[T comparable](in ...T) T {
Expand Down

0 comments on commit 840b143

Please sign in to comment.