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:
@@ -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 从数据库构建渠道缓存。
|
||||
|
||||
Reference in New Issue
Block a user