code: func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) {
  	var merge DirsMerger = f.Merger
  	if merge == nil {
  		merge = defaultUnionMergeDirsFn
  	}
  
  	if f.off == 0 {
  		var lfi []os.FileInfo
  		if f.Layer != nil {
  			lfi, err = f.Layer.Readdir(-1)
  			if err != nil {
  				return nil, err
  			}
  		}
  
  		var bfi []os.FileInfo
  		if f.Base != nil {
  			bfi, err = f.Base.Readdir(-1)
  			if err != nil {
  				return nil, err
  			}
  
  		}
  		merged, err := merge(lfi, bfi)
  		if err != nil {
  			return nil, err
  		}
  		f.files = append(f.files, merged...)
  	}
  
  	if c <= 0 && len(f.files) == 0 {
  		return f.files, nil
  	}
  
  	if f.off >= len(f.files) {
  		return nil, io.EOF
  	}
  
  	if c <= 0 {
  		return f.files[f.off:], nil
  	}
  
  	if c > len(f.files) {
  		c = len(f.files)
  	}
  
  	defer func() { f.off += c }()
  	return f.files[f.off:c], nil
  }
docs: // Readdir will weave the two directories together and
  // return a single view of the overlayed directories.
  // At the end of the directory view, the error is io.EOF if c > 0.