mirror of
https://github.com/golang/go
synced 2024-11-20 02:54:39 -07:00
archive/tar: fix example's handling of os.EOF.
Fixes #1677. R=r CC=golang-dev https://golang.org/cl/4402042
This commit is contained in:
parent
328aac3a49
commit
1de71a07e0
@ -27,13 +27,13 @@ var (
|
||||
// tr := tar.NewReader(r)
|
||||
// for {
|
||||
// hdr, err := tr.Next()
|
||||
// if err != nil {
|
||||
// // handle error
|
||||
// }
|
||||
// if hdr == nil {
|
||||
// if err == os.EOF {
|
||||
// // end of tar archive
|
||||
// break
|
||||
// }
|
||||
// if err != nil {
|
||||
// // handle error
|
||||
// }
|
||||
// io.Copy(data, tr)
|
||||
// }
|
||||
type Reader struct {
|
||||
|
Loading…
Reference in New Issue
Block a user