Consider the following:
fi, _ := os.Stat("/home/")
h, _ := zip.FileInfoHeader(fi)
fmt.Println(h.Name)
This currently prints:
However, ZIP treats directories as files with a trailing "/" in the name, which FileInfoHeader should automatically append if os.FileInfo.IsDir reports true.
This difference is minor since users are usually expected to replace the FileHeader.Name shortly afterwards anyways.
Consider the following:
This currently prints:
However, ZIP treats directories as files with a trailing "/" in the name, which
FileInfoHeadershould automatically append ifos.FileInfo.IsDirreports true.This difference is minor since users are usually expected to replace the
FileHeader.Nameshortly afterwards anyways.