mirror of
https://github.com/golang/go.git
synced 2025-05-30 19:52:53 +00:00
archive/tar: remove loop label from reader
CL 14624 introduced this label. At that time, the switch-case had a break to label statement which made this necessary. But now, the code no longer has a break statement and it directly returns. Hence, it is no longer necessary to have a label. Change-Id: Idde0fcc4d2db2d76424679f5acfe33ab8573bce4 Reviewed-on: https://go-review.googlesource.com/96935 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
7a218942be
commit
39852bf4cc
@ -64,7 +64,6 @@ func (tr *Reader) next() (*Header, error) {
|
|||||||
// normally be visible to the outside. As such, this loop iterates through
|
// normally be visible to the outside. As such, this loop iterates through
|
||||||
// one or more "header files" until it finds a "normal file".
|
// one or more "header files" until it finds a "normal file".
|
||||||
format := FormatUSTAR | FormatPAX | FormatGNU
|
format := FormatUSTAR | FormatPAX | FormatGNU
|
||||||
loop:
|
|
||||||
for {
|
for {
|
||||||
// Discard the remainder of the file and any padding.
|
// Discard the remainder of the file and any padding.
|
||||||
if err := discard(tr.r, tr.curr.PhysicalRemaining()); err != nil {
|
if err := discard(tr.r, tr.curr.PhysicalRemaining()); err != nil {
|
||||||
@ -102,7 +101,7 @@ loop:
|
|||||||
Format: format,
|
Format: format,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
continue loop // This is a meta header affecting the next header
|
continue // This is a meta header affecting the next header
|
||||||
case TypeGNULongName, TypeGNULongLink:
|
case TypeGNULongName, TypeGNULongLink:
|
||||||
format.mayOnlyBe(FormatGNU)
|
format.mayOnlyBe(FormatGNU)
|
||||||
realname, err := ioutil.ReadAll(tr)
|
realname, err := ioutil.ReadAll(tr)
|
||||||
@ -117,7 +116,7 @@ loop:
|
|||||||
case TypeGNULongLink:
|
case TypeGNULongLink:
|
||||||
gnuLongLink = p.parseString(realname)
|
gnuLongLink = p.parseString(realname)
|
||||||
}
|
}
|
||||||
continue loop // This is a meta header affecting the next header
|
continue // This is a meta header affecting the next header
|
||||||
default:
|
default:
|
||||||
// The old GNU sparse format is handled here since it is technically
|
// The old GNU sparse format is handled here since it is technically
|
||||||
// just a regular file with additional attributes.
|
// just a regular file with additional attributes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user