Golang archive/tar.Next() function example

package archive/tar

Next advances to the next entry in the tar archive.

tar.Next() usage example

 tarread := tar.NewReader(read)

 // Loop through the files in the tar archive
 for {
 tarnextread,err  := tarread.Next()
 if err == io.EOF {
 // end of tar archive
 break
 }
 }

Reference :

http://golang.org/pkg/archive/tar/#Reader.Next

Advertisement