code: func archiveRead(u *url.URL, tr *tar.Reader) error {
  	for {
  		header, err := tr.Next()
  		if err != nil {
  			if err == io.EOF {
  				return nil
  			}
  			return err
  		}
  
  		name := filepath.Join(u.Path, header.Name)
  		mode := os.FileMode(header.Mode)
  
  		switch header.Typeflag {
  		case tar.TypeDir:
  			err = os.MkdirAll(name, mode)
  		case tar.TypeReg:
  			_ = os.MkdirAll(filepath.Dir(name), 0750)
  
  			var f *os.File
  
  			f, err = os.OpenFile(name, os.O_CREATE|os.O_RDWR|os.O_TRUNC, mode)
  			if err == nil {
  				_, cerr := io.Copy(f, tr)
  				err = f.Close()
  				if cerr != nil {
  					err = cerr
  				}
  			}
  		case tar.TypeSymlink:
  			err = os.Symlink(header.Linkname, name)
  		}
  
  		// TODO: Uid/Gid may not be meaningful here without some mapping.
  		// The other option to consider would be making use of the guest auth user ID.
  		// os.Lchown(name, header.Uid, header.Gid)
  
  		if err != nil {
  			return err
  		}
  	}
  }
docs: // archiveRead writes the contents of the given tar.Reader to the given directory.