gonzojive commented on code in PR #21943:
URL: https://github.com/apache/beam/pull/21943#discussion_r906638189


##########
sdks/go/pkg/beam/io/filesystem/memfs/memory.go:
##########
@@ -54,14 +55,18 @@ func (f *fs) List(_ context.Context, glob string) 
([]string, error) {
        f.mu.Lock()
        defer f.mu.Unlock()
 
-       pattern, err := regexp.Compile(glob)
-       if err != nil {
-               return nil, err
+       globNoScheme := strings.TrimPrefix(glob, "memfs://")
+       if globNoScheme == glob {
+               return nil, fmt.Errorf("invalid pattern %q does not have prefix 
memfs://", glob)
        }
 
        var ret []string
        for k := range f.m {
-               if pattern.MatchString(k) {
+               matched, err := path.Match(globNoScheme, strings.TrimPrefix(k, 
"memfs://"))

Review Comment:
   Done.
   
   Please note that I also made the pattern accepted by List() more tolerant. 
It no longer requires a memfs:// prefix.



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to