tanmayrauth commented on code in PR #917:
URL: https://github.com/apache/iceberg-go/pull/917#discussion_r3103219453
##########
io/local.go:
##########
@@ -47,3 +48,12 @@ func (LocalFS) WriteFile(name string, content []byte) error {
func (LocalFS) Remove(name string) error {
return os.Remove(strings.TrimPrefix(name, "file://"))
}
+
+func (LocalFS) WalkDir(root string, fn fs.WalkDirFunc) error {
+ cleanRoot := strings.TrimPrefix(root, "file://")
+ if cleanRoot == "" {
+ cleanRoot = "."
+ }
Review Comment:
It was a defensive guard for the edge case root == "file://" (no path),
where TrimPrefix yields "" and filepath.WalkDir("") returns an error. But a
bare file:// with no path isn't a valid table location, so removed.
--
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]