code: func (fs *MockFilesystem) Stat(name string) (os.FileInfo, error) {
  	_, ok := fs.Files[name]
  	if ok {
  		// return file based mock FileInfo
  		tmpFile, err := ioutil.TempFile("", name)
  		if err != nil {
  			return nil, err
  		}
  		defer os.Remove(tmpFile.Name())
  
  		return os.Stat(tmpFile.Name())
  	}
  
  	dirName := name + "/"
  	for path := range fs.Files {
  		if strings.HasPrefix(path, dirName) {
  			// return dir based mock FileInfo
  			tmpDir, err := ioutil.TempDir("", name)
  			if err != nil {
  				return nil, err
  			}
  			defer os.RemoveAll(tmpDir)
  
  			return os.Stat(tmpDir)
  		}
  	}
  
  	return nil, &os.PathError{Err: errors.New(name + ": No such file.")}
  }
docs: // Stat returns a generic FileInfo for all files in fs.Files.
  // If the file does not exist it returns an os.PathError