Golang archive/zip.FileInfoHeader() function usage example

package archive/zip

FileInfoHeader creates a partially-populated FileHeader from an os.FileInfo. Because os.FileInfo's Name method returns only the base name of the file it describes, it may be necessary to modify the Name field of the returned header to provide the full path name of the file.

zip.FileInfoHeader() function usage example

 fileInfo := file.Stat()
 header := zip.FileInfoHeader(fileInfo)

Advertisement