code: func (c *cmd) createArchive() error {
  	path := c.output + debugArchiveExtension
  
  	tempName, err := c.createArchiveTemp(path)
  	if err != nil {
  		return err
  	}
  
  	if err := os.Rename(tempName, path); err != nil {
  		return err
  	}
  	// fsync the dir to make the rename stick
  	if err := syncParentDir(path); err != nil {
  		return err
  	}
  
  	// Remove directory that has been archived
  	if err := os.RemoveAll(c.output); err != nil {
  		return fmt.Errorf("failed to remove archived directory: %s", err)
  	}
  
  	return nil
  }
docs: // createArchive walks the files in the temporary directory
  // and creates a tar file that is gzipped with the contents