code: func (u *Untar) checkEntryAgainstWhitelist(header *tar.Header) bool {
  	if len(u.PathWhitelist) == 0 {
  		return true
  	}
  
  	name := "/" + filepath.Clean(header.Name)
  
  	for _, p := range u.PathWhitelist {
  		// Whitelist: "/foo"  File: "/foo"
  		if p == name {
  			return true
  		}
  
  		if strings.HasSuffix(p, "/") {
  			// Whitelist: "/usr/bin/"  Dir: "/usr/bin"
  			if p == name+"/" && header.Typeflag == tar.TypeDir {
  				return true
  			}
  
  			// Whitelist: "/usr/bin/"  File: "/usr/bin/bash"
  			if strings.HasPrefix(name, p) {
  				return true
  			}
  		}
  	}
  
  	return false
  }
docs: // checkEntryAgainstWhitelist will check if the specified file should be allowed
  // to be extracted against the current PathWhitelist. If no PathWhitelist is
  // allowed, then it will allow all files.