Golang archive/tar.Read() function example
package archive/tar
Read reads from the current entry in the tar archive. It returns 0, io.EOF when it reaches the end of that entry, until Next is called to advance to the next entry.
tar.Read() usage example
tarreader := tar.NewReader(read)
tar_read,err := tarreader.Read() // read current file in archive
if err == io.EOF {
// end of tar archive
fmt.Println('No more files to read in tar archive!')
}
Reference :
Advertisement
Something interesting
Tutorials
+14k Golang: Pad right or print ending(suffix) zero or spaces in fmt.Printf example
+17.9k Golang : Qt image viewer example
+9.1k Golang : Get curl -I or head data from URL example
+19.9k Golang : Measure http.Get() execution time
+13.1k Golang : List objects in AWS S3 bucket
+14.3k Golang : Recombine chunked files example
+16.3k Golang : Loop each day of the current month example
+6.4k PHP : Proper way to get UTF-8 character or string length
+30.4k Golang : How to verify uploaded file is image or allowed file types
+10.6k Golang : Allow Cross-Origin Resource Sharing request
+12.7k Golang : Sort and reverse sort a slice of bytes
+4.7k Fix Google Analytics Redundant Hostnames problem