code: func extractFile(tarball *tar.Reader, header *tar.Header, dir string) error {
  	switch header.Typeflag {
  	case tar.TypeDir:
  		return withDir(filepath.Join(dir, header.Name), nil)
  	case tar.TypeBlock, tar.TypeChar, tar.TypeReg, tar.TypeRegA, tar.TypeFifo:
  		return writeFile(filepath.Join(dir, header.Name), tarball, header.FileInfo().Mode())
  	case tar.TypeLink:
  		return writeHardLink(filepath.Join(dir, header.Name), filepath.Join(dir, header.Linkname))
  	case tar.TypeSymlink:
  		return writeSymbolicLink(filepath.Join(dir, header.Name), header.Linkname)
  	default:
  		log.Warnf("Unsupported type flag %v for %v.", header.Typeflag, header.Name)
  	}
  	return nil
  }
docs: // extractFile extracts a single file or directory from tarball into dir.
  // Uses header to determine the type of item to create
  // Based on https://github.com/mholt/archiver