zeroshade commented on code in PR #2664:
URL: https://github.com/apache/iceberg-go/pull/2664#discussion_r4645683941
##########
catalog/registry.go:
##########
@@ -230,5 +264,18 @@ func (r *Registry) Load(ctx context.Context, name string,
props iceberg.Properti
return nil, fmt.Errorf("%w: %s", ErrCatalogNotFound,
catalogType)
}
+ var options loadOptions
+ for _, opt := range opts {
+ opt(&options)
+ }
+ if options.ioRegistry != nil {
+ factory, ok := cat.(IORegistryRegistrarFunc)
Review Comment:
This only matches the concrete `IORegistryRegistrarFunc` type, so a custom
registrar written as a struct, or one that wraps another registrar, can't opt
in. An optional interface would cover both, with the func type implementing it:
```go
type IORegistryRegistrar interface {
Registrar
GetCatalogWithIORegistry(ctx context.Context, name string, props
iceberg.Properties, registry *iceio.Registry) (Catalog, error)
}
```
The check then becomes `cat.(IORegistryRegistrar)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]