laskoviymishka commented on code in PR #2742:
URL: https://github.com/apache/iceberg-go/pull/2742#discussion_r4730161056
##########
io/registry.go:
##########
@@ -37,6 +37,8 @@ var (
ErrSchemeAlreadyRegistered = errors.New("io scheme already registered")
// ErrInvalidSchemeFactory indicates that an attempt was made to
register a nil factory.
ErrInvalidSchemeFactory = errors.New("io scheme factory is nil")
+ // ErrNilFileIO indicates that a scheme factory returned nil without an
error.
Review Comment:
Could the [`SchemeFactory`
doc](https://github.com/apache/iceberg-go/blob/83f4813b43ab0ba19ae45b49f838924ab4000b72/io/registry.go#L32-L33)
state the rule this check now enforces? Something like:
```go
// SchemeFactory creates an IO implementation for a URI and its properties.
// It must return a non-nil IO or a non-nil error; LoadFS rejects (nil, nil)
// with ErrNilFileIO.
```
The check compares the interface, so a typed nil like `(*T)(nil)` still
passes, same as on `main`. The doc is where factory authors would learn not to
return one.
--
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]