code: func (a RenameAdapter) WriteHeader(hdr *tar.Header) error {
  	if hdr.Name == a.Old {
  		hdr.Name = a.New
  	} else if strings.HasPrefix(hdr.Name, a.Old+"/") {
  		hdr.Name = a.New + hdr.Name[len(a.Old):]
  	}
  
  	return a.Writer.WriteHeader(hdr)
  }
docs: // WriteHeader renames files and directories inline as a tarfile is being
  // written