File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package deb_test
22
33import (
44 "bytes"
5- "io/fs"
65 "path/filepath"
76 "sort"
87 "strings"
@@ -333,7 +332,7 @@ func (s *S) TestExtract(c *C) {
333332 createdPaths := make (map [string ]bool )
334333 options .Create = func (_ * deb.ExtractInfo , o * fsutil.CreateOptions ) error {
335334 relPath := filepath .Clean ("/" + strings .TrimPrefix (o .Path , dir ))
336- if o .Mode & fs . ModeDir != 0 {
335+ if o .Mode . IsDir () {
337336 relPath = relPath + "/"
338337 }
339338 createdPaths [relPath ] = true
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ func (r *Report) Add(slice *setup.Slice, fsEntry *fsutil.Entry) error {
4242 return fmt .Errorf ("cannot add path %q outside of root %q" , fsEntry .Path , r .Root )
4343 }
4444 relPath := filepath .Clean ("/" + strings .TrimPrefix (fsEntry .Path , r .Root ))
45- if fsEntry .Mode & fs . ModeDir != 0 {
45+ if fsEntry .Mode . IsDir () {
4646 relPath = relPath + "/"
4747 }
4848
Original file line number Diff line number Diff line change 55 "bytes"
66 "fmt"
77 "io"
8- "io/fs"
98 "os"
109 "path/filepath"
1110 "strings"
@@ -175,7 +174,7 @@ func Run(options *RunOptions) (*Report, error) {
175174 // Check whether the file was created because it matched a glob.
176175 if strings .ContainsAny (extractInfo .Path , "*?" ) {
177176 relPath := filepath .Clean ("/" + strings .TrimLeft (o .Path , targetDir ))
178- if o .Mode & fs . ModeDir != 0 {
177+ if o .Mode . IsDir () {
179178 relPath = relPath + "/"
180179 }
181180 globbedPaths [extractInfo .Path ] = append (globbedPaths [extractInfo .Path ], relPath )
You can’t perform that action at this time.
0 commit comments