1
0
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:
David Symonds 2013-02-05 15:39:55 +11:00
parent d1e16d06b4
commit e7fe1944ac

View File

@ -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()