Golang archive/zip.NewReader() function usage example
package archive/zip
NewReader returns a new Reader reading from r, which is assumed to have the given size in bytes.
zip.NewReader() function usage example
file, err := os.Open(“files.zip”)
if err != nil {
return err
}
defer file.Close()
const size = 8192 // fixed at 8KB, but in real life better to calculate size during runtime
var fileReader io.ReaderAt = file
if fileReader, err = zip.NewReader(file, size); err != nil {
return err
}
defer fileReader.Close()
Advertisement
Something interesting
Tutorials
+14.5k How to automatically restart your crashed Golang server
+4.7k Chrome : How to block socketloop.com links in Google SERP?
+12.7k Golang : Pass database connection to function called from another package and HTTP Handler
+19.9k Golang : Count JSON objects and convert to slice/array
+24k Golang : Find biggest/largest number in array
+20.6k Nginx + FastCGI + Go Setup.
+11.6k Android Studio : Create custom icons for your application example
+4.6k Mac OSX : Get disk partitions' size, type and name
+5.8k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error
+28.2k Golang : Connect to database (MySQL/MariaDB) server
+9.9k Golang : ffmpeg with os/exec.Command() returns non-zero status
+12.3k Golang : How to display image file or expose CSS, JS files from localhost?