code: func FileInfoHeader(name string, fi os.FileInfo, link string) (*tar.Header, error) {
  	hdr, err := tar.FileInfoHeader(fi, link)
  	if err != nil {
  		return nil, err
  	}
  	hdr.Format = tar.FormatPAX
  	hdr.ModTime = hdr.ModTime.Truncate(time.Second)
  	hdr.AccessTime = time.Time{}
  	hdr.ChangeTime = time.Time{}
  	hdr.Mode = fillGo18FileTypeBits(int64(chmodTarEntry(os.FileMode(hdr.Mode))), fi)
  	hdr.Name = canonicalTarName(name, fi.IsDir())
  	if err := setHeaderForSpecialDevice(hdr, name, fi.Sys()); err != nil {
  		return nil, err
  	}
  	return hdr, nil
  }
docs: // FileInfoHeader creates a populated Header from fi.
  // Compared to archive pkg this function fills in more information.
  // Also, regardless of Go version, this function fills file type bits (e.g. hdr.Mode |= modeISDIR),
  // which have been deleted since Go 1.9 archive/tar.