code: func (t *Tar) shouldBeExcluded(name string, isDir bool) bool {
  	name = filepath.ToSlash(filepath.Clean(name))
  	var exclude bool
  	for _, re := range t.ignorePaths {
  		if re.regexp.MatchString(name) || re.regexp.MatchString(filepath.Base(name)) {
  			if !re.dirOnly || (re.dirOnly && isDir) {
  				exclude = re.exclude
  			}
  		}
  	}
  
  	return exclude
  }
docs: // shouldBeExcluded determines if supplied name is contained in the slice of
  // files to exclude. ignorePaths are considered in order so that files excluded
  // by one criteria can be reincluded by a later one.