fix: resolve golangci-lint issues

- Fix errcheck: defer rows.Close() with nolint
- Fix errcheck: type assertion with ok check in channel cache
- Fix staticcheck ST1005: lowercase error string
- Fix staticcheck SA5011: nil check cost before use in openai gateway
- Fix gofmt: format chatcompletions_to_responses.go
This commit is contained in:
erio
2026-04-04 11:17:24 +08:00
parent d72ac92694
commit 3851628a43
5 changed files with 32 additions and 25 deletions
+5 -1
View File
@@ -176,7 +176,11 @@ func (s *ChannelService) loadCache(ctx context.Context) (*channelCache, error) {
if err != nil {
return nil, err
}
return result.(*channelCache), nil
cache, ok := result.(*channelCache)
if !ok {
return nil, fmt.Errorf("unexpected cache type")
}
return cache, nil
}
// buildCache 从数据库构建渠道缓存。