From 47c33664151eb58ec1a108e8130108b3a61e2575 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Thu, 24 Jul 2025 09:39:43 +0200 Subject: [PATCH] chore: lint --- cmd/openrouter/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/openrouter/main.go b/cmd/openrouter/main.go index b07daacf3e53dd0cb3aaa7846a43cf0b4b267694..f35cf5c57169fe3995b92ae34ed73221edd35e6d 100644 --- a/cmd/openrouter/main.go +++ b/cmd/openrouter/main.go @@ -181,7 +181,7 @@ func selectBestEndpoint(endpoints []Endpoint) *Endpoint { if len(endpoints) == 0 { return nil } - + var best *Endpoint for i := range endpoints { endpoint := &endpoints[i] @@ -189,12 +189,12 @@ func selectBestEndpoint(endpoints []Endpoint) *Endpoint { if endpoint.Status < 0 || endpoint.UptimeLast30m < 90.0 { continue } - + if best == nil { best = endpoint continue } - + // Prefer higher context length if endpoint.ContextLength > best.ContextLength { best = endpoint @@ -205,12 +205,12 @@ func selectBestEndpoint(endpoints []Endpoint) *Endpoint { } } } - + // If no good endpoint found, return the first one as fallback if best == nil { best = &endpoints[0] } - + return best } @@ -331,7 +331,7 @@ func main() { } openRouterProvider.Models = append(openRouterProvider.Models, m) - fmt.Printf("Added model %s with context window %d from provider %s\n", + fmt.Printf("Added model %s with context window %d from provider %s\n", model.ID, bestEndpoint.ContextLength, bestEndpoint.ProviderName) }