code: func New(dir string) (*MemoryPurse, error) {
  	dir = filepath.Clean(dir) + string(os.PathSeparator)
  	f, err := os.Open(dir)
  	if err != nil {
  		return nil, err
  	}
  	defer f.Close()
  
  	fis, err := f.Readdir(-1)
  	if err != nil {
  		return nil, err
  	}
  
  	p := &MemoryPurse{files: make(map[string]string, 0)}
  
  	for _, fi := range fis {
  		if !fi.IsDir() {
  			if filepath.Ext(fi.Name()) == ext {
  				err = addToPurse(p, fi.Name(), filepath.Join(dir, fi.Name()))
  			}
  		} else {
  			err = filepath.Walk(filepath.Join(dir, fi.Name()), func(path string, info os.FileInfo, err error) error {
  				if err != nil {
  					return err
  				}
  				if info.IsDir() || filepath.Ext(info.Name()) != ext {
  					return nil
  				}
  				return addToPurse(p, strings.TrimPrefix(path, dir), path)
  			})
  		}
  		if err != nil {
  			return nil, err
  		}
  	}
  	return p, nil
  }
docs: // New loads SQL files' contents in the specified directory dir into memory.
  // A file's contents can be accessed with the Get method.
  //
  // New returns an error if the directory does not exist or is not a directory.