Commit 1de71a07 authored by David Symonds's avatar David Symonds

archive/tar: fix example's handling of os.EOF.

Fixes #1677.

R=r
CC=golang-dev
https://golang.org/cl/4402042
parent 328aac3a
...@@ -27,13 +27,13 @@ var ( ...@@ -27,13 +27,13 @@ var (
// tr := tar.NewReader(r) // tr := tar.NewReader(r)
// for { // for {
// hdr, err := tr.Next() // hdr, err := tr.Next()
// if err != nil { // if err == os.EOF {
// // handle error
// }
// if hdr == nil {
// // end of tar archive // // end of tar archive
// break // break
// } // }
// if err != nil {
// // handle error
// }
// io.Copy(data, tr) // io.Copy(data, tr)
// } // }
type Reader struct { type Reader struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment