mirror of
https://github.com/golang/go
synced 2024-11-23 07:50:05 -07:00
archive/tar: small simplification using FileMode.
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7305043
This commit is contained in:
parent
d1e16d06b4
commit
e7fe1944ac
@ -80,7 +80,7 @@ func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) {
|
||||
Mode: int64(fi.Mode().Perm()), // or'd with c_IS* constants later
|
||||
}
|
||||
switch {
|
||||
case fi.Mode()&os.ModeType == 0:
|
||||
case fi.Mode().IsRegular():
|
||||
h.Mode |= c_ISREG
|
||||
h.Typeflag = TypeReg
|
||||
h.Size = fi.Size()
|
||||
|
Loading…
Reference in New Issue
Block a user