Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileInfoHeader ¶
FileInfoHeader creates a partially-populated [FileHeader] from an fs.FileInfo. Because fs.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. If compression is desired, callers should set the FileHeader.Method field; it is unset by default.
func NewReader ¶
NewReader returns a new [Reader] reading from r, which is assumed to have the given size in bytes.
If any file inside the archive uses a non-local name (as defined by [filepath.IsLocal]) or a name containing backslashes and the GODEBUG environment variable contains `zipinsecurepath=0`, NewReader returns the reader with an [ErrInsecurePath] error. A future version of Go may introduce this behavior by default. Programs that want to accept non-local names can ignore the [ErrInsecurePath] error and use the returned reader.
func OpenReader ¶
func OpenReader(t testing.TB, name string) *zip.ReadCloser
OpenReader will open the Zip file specified by name and return a ReadCloser.
If any file inside the archive uses a non-local name (as defined by [filepath.IsLocal]) or a name containing backslashes and the GODEBUG environment variable contains `zipinsecurepath=0`, OpenReader returns the reader with an ErrInsecurePath error. A future version of Go may introduce this behavior by default. Programs that want to accept non-local names can ignore the ErrInsecurePath error and use the returned reader.
Types ¶
This section is empty.