]> Cypherpunks repositories - gostls13.git/commitdiff
archive/tar: small simplification using FileMode.
authorDavid Symonds <dsymonds@golang.org>
Tue, 5 Feb 2013 04:39:55 +0000 (15:39 +1100)
committerDavid Symonds <dsymonds@golang.org>
Tue, 5 Feb 2013 04:39:55 +0000 (15:39 +1100)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7305043

src/pkg/archive/tar/common.go

index 921b9fe9bdd1420186959d82e5383c578c860ec2..74a0f0e3c14925b63c82c02c3ee59516a9cf411d 100644 (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()