You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: memory.go
    path of file: ./repos/beam/sdks/go/pkg/beam/io/filesystem/memfs
    
    the code of the file until where you have to start completion: // Licensed to the Apache Software Foundation (ASF) under one or more

    
func (f *fs) List(_ context.Context, glob string) ([]string, error) {
	f.mu.Lock()
	defer f.mu.Unlock()

	// As with other functions, the memfs:// prefix is optional.
	globNoScheme := strings.TrimPrefix(glob, "memfs://")

	var ret []string
	for k := range f.m {
		matched, err := filesystem.Match(globNoScheme, strings.TrimPrefix(k, "memfs://"))
		if err != nil {
			return nil, fmt.Errorf("invalid glob pattern: %w", err)
		}
		if matched {
			ret = append(ret, k)
		}
	}
	sort.Strings(ret)
	return ret, nil
}